"git add -A" is equivalent to "git add .; git add -u".

  • git add -A stages All
  • git add . stages new and modified, without deleted
  • git add -u stages modified and deleted, without new
 
 
git init
echo Change me > change-me
echo Delete me > delete-me
git add change-me delete-me
git commit -m initial echo OK >> change-me
rm delete-me
echo Add me > add-me git status
# Changed but not updated:
# modified: change-me
# deleted: delete-me
# Untracked files:
# add-me git add .
git status # Changes to be committed:
# new file: add-me
# modified: change-me
# Changed but not updated:
# deleted: delete-me git reset git add -u
git status # Changes to be committed:
# modified: change-me
# deleted: delete-me
# Untracked files:
# add-me git reset git add -A
git status # Changes to be committed:
# new file: add-me
# modified: change-me
上一篇:APC注入(Ring3层)


下一篇:Linux下的设置静态IP命令详解