开发者

git rebase conflicts while merging works fine

Good day.

I was working with git simple svn-like way, doing git pull every evening and was pretty happy with it. But there was annoying thng that on every pull i getting record in git log about merging. To get rid of that merging i trying to start using

git pull --rebase origin master

instead of simple pull, but that command gives me lots of conflict errors while i just changed nothing at all, only thing i want is to be in sync with remote repo, which seem to be painful task to accomplish.

And i just wondering where those conflicts are coming from and while merge just works.

Here is how error messages look like: warning: squelched 56 whitespace errors warning: 61 lines add whitespace errors. Falling back to patching base and 3-way merge... Auto-merging promo.pl CONFLICT 开发者_JS百科(content): Merge conflict in promo.pl

Also i played with following spells which did not helped:

git config core.whitespace nowarn
git config core.autocrlf false

It seems that git dislike my whitespaces for some reason and destroying it and even don't ask any permission, how to forbid this ?


The problem is likely that your commits do not cleanly apply to the current state of the remote repo. This reveals the essential difference between git pull merge and git pull rebase:

merge pulls the latest commits from the repo and applies them on top of your commits. rebase pulls the latest state of the repo and applies your commits on top of it.

The most likely issue is that your commits, applied cleanly to the HEAD you started from, do not apply cleanly to the current remote HEAD.

For more info try Why does git pull --rebase fail when replaying existing commits? and git rebase, keeping track of 'local' and 'remote'

As for the whitespace warnings, they are just that, warnings. Although I would recommend keeping your whitespace clean for clarity of diffs, they don't ever cause merge conflicts as far as I know.

P.S. if the merge commits in the log annoy you, give git log --no-merges a try.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜