Git committing unchanged files
Long story short, I have a situation where egit allows unchanged files to be committed. If I c开发者_C百科ommit, will this corrupt the git repository?
Unchanged files are always committed in git. Each commit is the entire tree of files along with a commit message. Unless you have a specific strange situation which is not adequately captured by the description "unchanged files" there will be no problem.
To answer your questions specifically, git commit
commits those files in the index, including files that are unchanged from what is in the repository. There are several ways to include a file in the index (see the git-commit
man page).
Git commits files based upon their hash code; if it is unchanged (as would be the case if the files are truly unchanged), then nothing is stored. But in any event, whether or not a file is unchanged when committed, a git commit
will not corrupt the repository.
精彩评论