HELP: 4.3 branch in KDevelop messed up
Andreas Pakulat
apaku at gmx.de
Tue Apr 17 09:57:46 UTC 2012
On 17.04.12 11:26:51, Milian Wolff wrote:
> Hey all,
>
> I just noticed that apparently I severly messed up the 4.3 branch in the
> KDevelop repo, such that it is now equal to the master branch...
>
> I don't really get how I managed to do this... can someone help me?
>
> http://quickgit.kde.org/index.php?p=kdevelop.git&a=shortlog&h=refs/heads/4.3
> http://quickgit.kde.org/index.php?p=kdevelop.git&a=shortlog&h=refs/heads/master
>
> ^- those are equal...
>
> The only thing I just did was something like:
>
> $ write change in master branch
> $ git stash
> $ git checkout 4.3
> $ git stash pop
> $ git commit
> $ do a small fixup change
> $ git commit
> $ git rebase -i origin 4.3
> $ git push
>
> (the commit I thus pushed is this one:
> http://quickgit.kde.org/index.php?p=kdevelop.git&a=commit&h=5799abe3b73b5ee1cfda275e463529d47f35e77f)
>
> Help!
As Alexandre already said, to fix this up you'll need to git push -f,
which requires sysadmins to enable this for you IIRC.
The easiest way to get the 4.3 branch where you wanted it is to use git
reflog to find the original commit hash it was on, then git reset --hard
<commit-hash> while you have 4.3 checked out. Then re-apply the pushed
commit using git cherry-pick and then merge 4.3 into master again.
This most probably happened because you did git rebase -i origin 4.3,
never saw that syntax but I can see how this might have used origin's
HEAD (which points to master) to rebase 4.3 onto it (i.e. your local
commits in 4.3). git rebase -i origin/4.3 4.3 is probably what you
wanted, but I usually just do a git rebase -i HEAD~<n> where n is the
number of commits I want to interactively rebase for squashing/fixup
etc.
Andreas
More information about the KDevelop-devel
mailing list