用GIT作版本控制-并上传至github(转)
用GIT做版本控制-并上传至github(转)
1
|
# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel |
1
2
3
4
|
# tar -zxvf git- 1.8 . 4.2 .tar.gz
# cd git- 1.8 . 4.2
# make prefix=/usr/local all # make prefix=/usr/local install |
1
2
|
# git config --global user.name "Leon Hao"
# git config --global user.email haolulue@ 163 .com
|
1
|
# git config --global core.editor emacs |
1
|
# git config --global merge.tool vimdiff |
1
2
3
|
[root@SK-UAT-MYSQL /]# git config --list user.name=Leon Hao user.email=haolulue@ 163 .com
|
1
|
# git init |
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# See http: //help.github.com/ignore-files/ for more about ignoring files.
# # If you find yourself ignoring temporary files generated by your text editor # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config. /.bundle # Ignore the default SQLite database.
/db/*.sqlite3 /db/*.sqlite3-journal # Ignore all logfiles and tempfiles. /log/*.log /tmp |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# See http://help.github.com/ignore-files/ for more about ignoring files. # # If you find yourself ignoring temporary files generated by your text editor # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' # Ignore bundler config. /.bundle # Ignore the default SQLite database. /db/*.sqlite3 /db/*.sqlite3-journal # Ignore all logfiles and tempfiles. /log/*.log /tmp # Ignore other unneeded files. doc/ *.swp *~ .project .DS_Store .idea |
1
|
# git add . |
1
|
# git status |
1
|
# git commit -m "add README.MD"
|
1
|
# git log |
1
|
# git checkout -f |
1
|
# git checkout -b testfz |
1
|
# git branch |
1
|
# git mv README.rdoc README.md |
1
|
# git status |
1
|
# git add . |
1
|
# git commit -a -m "add"
|
1
|
# git checkout master |
1
|
# git merge testfz |
1
|
# git branch -d testfz |
1
2
|
# cd ~/.ssh/ # ssh-keygen -t rsa -C "haolulue@163.com"
|
1
2
3
4
5
|
# git remote add origin git@github.com:haoxiaolu/doccenter # git fetch # git commit -a -m "add file"
# git add . # git push |