git sync with rebase showing other people's files as modified locally

ε祈祈猫儿з 提交于 2019-12-06 12:54:20

问题


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.

  1. 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?
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!