开发者

Git committing unchanged files

开发者 https://www.devze.com 2023-03-11 02:38 出处:网络
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 c

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号