问题
Our team just moved to use github as our primary code repository, and are going through teething pains. We're all familiar with SVN (our previous repo).
We're all committing to the repo's master, and have rebase option turned on (we're all using Github for PC, btw). It's my understanding that with rebase turned on, syncing becomes comparable to doing an "svn up" in that it merges in all changes into your local checkout. Only when there's actually a file merge will you be prompted to handle
However, we're finding that we're having two oddities.
- Files that other people have changed are now showing up my lists of "modified files" and need to be re-committed. I haven't touched them. Why would this ever occur with a rebase?
- We're all seeing a "failed to sync this branch - you might need to open a shell and debug the state of this repo" message. Presumably this one occurs is when there's a legitimate conflict...?
Could anyone shed a little light on either of these? Thanks...!
回答1:
Make sure you have core.autocrlf
set to false.
cd /path/to/your/repo
git config core.autocrlf false
Then renormalize your repo (make sure you don't have any work in progress, or, even better, do it in a separate clone)
git rm --cached -r .
git reset --hard
Check now if you still have modifications due to "line ending modification".
来源:https://stackoverflow.com/questions/20203667/git-sync-with-rebase-showing-other-peoples-files-as-modified-locally