On Fri, Apr 27, 2012 at 05:39:02PM -0300, Ademar de Souza Reis Jr. wrote:
>
> Below is a different approach, which I consider simpler but
> requires a bit more understanding of git:
>
> First of all, if you run git pull on top of your curren branch,
> it'll break with tons of conflicts. In this case, just run:
> $ git reset --hard
> and things will get back to normal (as before git pull)
>
> Now for the "migration" procedure, assuming origin points to the
> upstream git repository (the default).
>
> (DISCLAIMER: untested)
Or you can drive like a git pro: (recalling from memory from lots of use)
1. Find your current branch name (git branch - look for the *)
2. checkout a new branch "git checkout -b <branch>_new"
3. Find your fork point using 'git log' or if you haven't fetch'd Lucas's
tree yet - "git log --oneline origin/master..HEAD" (the bottom commit sha
is what you want)
4. Fetch Lucas's tree - 'git fetch origin'
5. The cool trick (assuming Lucas's changes are in origin/master)
the <fork point SHA> should be the SHA of your _first_ commit in the
fork
"git rebase --onto origin/master <fork point>^ HEAD"
[notice the ^ after the fork point]
This creates a temporary branch with the contents of origin/master and
uses the commits between <fork point>^ and HEAD to apply them one by one
onto the temporary branch. If things are successful the <branch>_new
points to the successful temp branch when git rebase is done.
If things go bad, git rebase will stop. Use 'git status' to figure out
which files have conflicts, edit them, 'git add <file>' (no commit), and
'git rebase --continue' along.
If you get uncomfortable with the way things are going, 'git rebase
--abort' deletes the work and brings you back to your original
<branch>_new safely. :-)
6. Once successful, I assume Lucas only changed the history part and not
the actual file contents. Therefore a 'git diff <branch>' should show no
differences. Otherwise something got messed up in the rebase ("git reset
--hard <branch>" and try again).
7. Smile like a pro!
Cheers,
Don
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest