I have what I think is a really strange problem with merge conflicts during a rebase.
I'm trying to rebase a feature branch with a development branch:
git checkout myFeatureBranch
git rebase developBranch
Now git rebase reports conflicts and I have to use git mergetool to resolve conflicts.
git mergetool
Git mergetool declares a conflicted file myFile1.h
and the merge interface opens (the problem occurs on either Linux or Windows/tortoisegit for the same repo). What I see is that the "theirs" file is completely the wrong file myOtherFile.c
although the "mine" file is correctly showing myFile1.h
.
I've tried git gc --aggressive
and git fsck --full
. git gc reports no problems at all and git fsck has a lot of dangling stuff but no errors or missing information.
Is this some kind of corruption in the git database and if so, can it be repaired?
Any other possibilities for what is wrong?
I did think that perhaps I could merge the "mine" file back onto itself (ignoring all the incorrect "theirs" changes completely), and maybe this would clean up the problem, but I fear it could also make things worse.
Whatever the problem is, it does appear to be in our master remote repo as new clones exhibit the same rebase problem.
Thanks for your help.
git config -l
output with some redaction:
core.symlinks=false
core.autocrlf=input
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
core.autocrlf=true
core.excludesfile=<global exclude file>
user.name=Russell
user.email=<email address>
push.default=simple
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
remote.origin.url=<gituser@gitserver>
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.puttykeyfile=<key.ppk>
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.develop.remote=origin
branch.develop.merge=refs/heads/develop
branch.myFeatureBranch.remote=origin
branch.myFeatureBranch.merge=refs/heads/myFeatureBranch
git config -l
outputgit rebase develop
. The mergetool is meld in Linux, tortoisemerge in Windows. I can't publish the repo. I thought about making a test case but at the moment I don't have any ideas on how to reproduce the problem; I'll have to think about that one.rebase -p
.