checkout <branch>
switch branch
checkout -b <new branch>
create new branch and switch to it
checkout <file>
checkout file in HEAD and overwrite local file (NOTE: use it carefully, maybe lost your local work)
diff
diff index and working copy
diff --cached
diff index and last commit, which is what you will commit without '-a' option
log
display commit logs
log -p
include commit diff
log --first-parent
follow only the first parent commit upon seeing a merge commit. This option gives a better overview of the evolution of a particular branch.
log -S'string'
commits which add or remove data matching the 'string'
log -r --name-status
show changed files with full path and status, just like 'svn diff --summarize'
branch
display all branches, current branch started with *
branch -r
display remote branches
merge --no-commit
not commit immediately, all changes write to index
reset --mixed
default, adjust HEAD and clear index, changes in working copy is reserved, and changes between original HEAD and current HEAD will write to working copy
reset --soft
adjust HEAD, changes between original HEAD and current HEAD will write to index
reset --hard
adjust HEAD, and clear index and working copy (NOTES: only use it when you are sure that the changes in index, working copy and changes reset in history will never be used)
posted on 2008-05-27 00:29
JBahamut 阅读(169)
评论(0) 编辑 收藏