你在你面前做一個承諾git add .
?
在git add
或git commit
之前執行git status
以查看更改和上演的情況總是明智的。
做git diff
以查看您即將提交的具體更改也非常方便。
以下是git status
顯示的內容,如果您添加了文件並重命名了它。
[email protected]:~$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: foo.txt
#
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: foo.txt
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# bar.txt
此時你可以做git add .
然後git status will give you more information, perhaps pointing out that you still have a new file and a deleted file called
foo.txt的. To fix this you need to manually
的git RM foo.txt的before doing
混帳commit`
在,如果你有一個混帳回購協議要文件到未來移動你應該使用git mv
。
是什麼操作系統您使用的?具體來說,你在Windows上使用Git,如果是這樣,在哪個環境下? – 2009-11-16 23:15:04
Ubuntu服務器,git 1.5.6 – deepblue 2009-11-16 23:18:39
我可能會建議的第一件事是升級你的Git版本,最新版本是1.6.5.3。我很確定你引用的這些特定消息自1.5.x以來已經有所改進。 – 2009-11-16 23:25:14