Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Friday, July 30, 2010

git update-to

Reading this very useful GIT guide I thought of a possible addition to my GIT aliases set.
On my archlinux box git update-to origin mybranch is currently an alias for git pull --rebase origin mybranch.
It pulls with rebase instead of merge, thus avoiding many unnecessary commits in your history.
NB: It rebases to the branch the command is issued in!

Command to save the alias in your ".gitconfig":
git config --global alias.update-to pull --rebase

Final notes:
When rebasing fails with conflicts is often a good idea to simply merge (with "git pull origin master", for example): no "history-uncluttering" is this much valuable when conflicts-resolving steps in...

Friday, July 16, 2010

GIT Tip: Delete a Remote Branch

In GIT, when you're done with a remote branch you can*:
git push origin :mybranchname
Source: http://progit.org/book/ch3-5.html

* "can" doesn't mean "must" or "have to", you know...