git笔记
- git 安装
- git workflow
一.git安装:
- 参考
- 生成public key,private key
- more... or install git-client
二.git workflow:
- create & clone
create new repro | git init <your repro name>
create local repro | git clone [--local] <file:///local-repro-dir which contains .git dir>
create remote repro | git clone <remote-gitserver-repro>
- add or remove
add change to INDEX | git add <filename,.,*>
remove / delete | git rm <filename,.,*>
rename | git mv <old-file-name> <new-file-name>
----------------------or sometime you want to ----------------------------------------
INDEX status | git status [-s] [-l] more git status --help
- commit & 同步
commit all changes | git commit -m 'message ...'
---------------------------commit changes in INDEX-----------------------
commit all changes in INDEX | git commit -am '...' //not use 'git add ...' command
push changes to remote-git-server | git push [origin <your branch> ]
create local repro to remote-git-server | git remote add origin <remote-server>
update | git pull [origin <branch>]
-
branch
create now branch | git branch -b <branch-name>
switch between branches | git switch <branch-name>
delete | git branch -d <branch-name>
more ... | git branch --help
- merge
merge branch | git merge <source-branch> <target-branch>
view diff between branches | git diff <source-branch> <target-branch>
more... | git merge --help
- tagging
create tag | git tag <tag-name> [commit-id]
views log | git log //more type 'git log --help'
-
本人的小整理,高手勿喷。
参考:http://rogerdudler.github.com/git-guide/index.zh.html
- create & clone
create new repro | git init <your repro name>create local repro | git clone [--local] <file:///local-repro-dir which contains .git dir>create remote repro | git clone <remote-gitserver-repro>
- add or remove
add change to INDEX | git add <filename,.,*>remove / delete | git rm <filename,.,*>rename | git mv <old-file-name> <new-file-name>----------------------or sometime you want to ----------------------------------------INDEX status | git status [-s] [-l] more git status --help
- commit & 同步
commit all changes | git commit -m 'message ...'---------------------------commit changes in INDEX-----------------------commit all changes in INDEX | git commit -am '...' //not use 'git add ...' commandpush changes to remote-git-server | git push [origin <your branch> ]create local repro to remote-git-server | git remote add origin <remote-server>update | git pull [origin <branch>]
-
branchcreate now branch | git branch -b <branch-name>switch between branches | git switch <branch-name>delete | git branch -d <branch-name>more ... | git branch --help
- merge
merge branch | git merge <source-branch> <target-branch>view diff between branches | git diff <source-branch> <target-branch>more... | git merge --help
- tagging
create tag | git tag <tag-name> [commit-id]views log | git log //more type 'git log --help'
-
本人的小整理,高手勿喷。参考:http://rogerdudler.github.com/git-guide/index.zh.html