Remember to rebase

Austin Foxley austinf at cetoncorp.com
Tue May 5 20:00:26 UTC 2009


Carmelo Amoroso wrote:
> Indeed before actually pushing the changes, I've use git-push --dry-run.
> Git notified that the repo was not in synch, so I've executed git-pull origin
> (on both master and nptl branch), then git-push.
> Where did I fail ?  please let me know.

I wouldn't really call it a failure, just extra noise.

git-pull by default does a fetch then a merge. In your case when you had a commit 
that hadn't been pushed yet and there were upstream changes. You avoid the 
extraneous merge commit by running git-pull --rebase to get the upstream changes. 
The difference between a rebase and a merge is the key here. With a rebase, git 
rewrites your local commit history with the one from upstream, and then 
reapplies all your local work on top of it, which is what you want typically when 
working with a central repo like we are.

The only caveat is your local repo's history is rewritten so you shouldn't publish *that*.

man git-pull talks a bit about this.

Make sense?

-Austin


More information about the uClibc mailing list