顯示工作路徑下已修改的文件:
~~~
$ git status
~~~
顯示與上次提交版本文件的不同:
~~~
$ git diff
~~~
把當前所有修改添加到下次提交中:
~~~
$ git add
~~~
把對某個文件的修改添加到下次提交中:
~~~
$ git add -p <file>
~~~
提交本地的所有修改:
~~~
$ git commit -a
~~~
提交之前已標記的變化:
~~~
$ git commit
~~~
附加消息提交:
~~~
$ git commit -m 'message here'
~~~
提交,并將提交時間設置為之前的某個日期:
~~~
git commit --date="`date --date='n day ago'`" -am "Commit Message"
~~~
修改上次提交
_請勿修改已發布的提交記錄!_
~~~
$ git commit --amend
~~~
把當前分支中未提交的修改移動到其他分支
~~~
git stash
git checkout branch2
git stash pop
~~~