[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gits] Git woes
Leigh Stoller <lbstoller@gmail.com> writes:
> So this is a branch that I just rebased from central/master. I pushed
> up fine a couple of days ago and I have not done anything to it
> since then. Anyone have a clue?
If I understand correctly, you rebased your local "imageversion" branch.
This means that your local "imageversion" branch and the central "imageversion"
branch are very different! Something like this:
O-----O-----O-----O-----O-----O-----O master
\ \
O O
\ \
O O
central/ imageversion
imageversion
So although the two branches may "look similar," to git, they are quite
different.
"git push central imageversion" fails because git has no way to add commits to
central/imageversion to make it "catch up" to your imageversion branch.
My suggestion would be that you un-rebase your imageversion branch. This is a
little tricky :-(, because you have to dig up commits that are not referenced
by any branch. But StackOverflow suggests...
http://stackoverflow.com/questions/134882/undoing-a-git-rebase
Sounds easy enough:
git checkout imageversion
git reflog
# Find the commit that was the tip of your imageversion branch before
# you did the rebase
git reset --hard ...
Before attempting this surgery, I would be tempted to copy my local repo and
operate on that copy, so that I can make sure that I'm doing the right thing!
Then once I've got it down, I either redo the steps on my "real" local repo, or
I make the copy be my real local repo.
The upshot is that you shouldn't rebase a branch that is racking a branch from
emulab-devel.
Instead, if you want to incorporate changes into a shared topic branch, you
should just merge from master (or central/master if that is different):
git checkout imageversion
git merge master
Eric.
--
-------------------------------------------------------------------------------
Eric Eide <eeide@cs.utah.edu> . University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX