2

I'm relatively new to git SCM. By accident, I discovered that it is possible to stage unmodified files.

After making minor changes to a broad file set, I checked status (git status) then manually staged what I thought was my change set...

git add file1 file2 file3 file4 file5

...only to realize prior to committing that file2 had not been modified.

I removed file2 from the staged set and proceeded with my commit, but now I'm wondering what purpose might there be to committing unmodified file(s)?

4

1 回答 1

3

如前所述,暂存未修改的文件是无操作的

$ git status
# On branch gh-pages
nothing to commit (working directory clean)

$ git add README

$ git status
# On branch gh-pages
nothing to commit (working directory clean)
于 2013-06-02T02:56:35.697 回答