2
在Git 1.x中git add .
不包含已刪除的文件。但是從Git 2.0中它會包含哪些內容?是在Git 2.x`git add .`和`git add -A`是否一樣?
在Git 1.x中git add .
不包含已刪除的文件。但是從Git 2.0中它會包含哪些內容?是在Git 2.x`git add .`和`git add -A`是否一樣?
你是對的。 Reading the changelog for git 2.0.
git add <path>
是一樣的「git add -A <path>
」現在,讓 「git add dir/
」會發現你的路徑從目錄和 記錄去除去除。
在舊版本的Git中,「git add <path>
」用於忽略刪除。你可以說「
git add --ignore-removal <path>
」到 如果你真的想在<path>
上只添加添加或修改的路徑。
所以執行
git add .
將包括刪除的文件。
要獲得git add
前2.0
git add --ignore-removal .
執行這個從添加操作將「排除」刪除文件舊的行爲。
編輯:我做了周圍的一些話題進一步谷歌上搜索,發現this wonderful answer that expands on what I said.