Git Tip of the Day - pruning stale remote-tracking branches
by Kamil Paral
In the last month I read "Pro Git" book [1]. Sometimes I stumble upon something really interesting or useful I didn't know before. I decided to share some tips with you from time to time, since it can help all of us in our day-to-day work. If you have some further tips, don't be afraid to share.
[1] http://progit.org/book/
Today's menu of git tips says "pruning stale remote-tracking branches":
You probably know "git remote" command. It shows information about your remote repositories. Try this one out:
$ git remote show origin
What you might not know is that this command allows you to prune all your local branches that track an already-deleted remote branch.
I often remove remote feature branches after the changes have been merged into master and the branch is not needed anymore, in order to "tidy up". But if you checked out that branch into your local one and set it as tracking, "git pull" won't delete such local branches for you. So how do you know which local branches doesn't exist on the server anymore? Easily, just run:
$ git remote prune origin --dry-run
and you'll receive a list of your stale remote-tracking branches. If you run it without --dry-run option, it will remove them for you.
Happy gitting!
13 years
Who's working on which bugs?
by Tim Flink
I assume that kparal is working on #304 since he just sent a patch out
on #fedora-qa but I'm not sure who else is working on what.
Specifically, I was going to start digging into #303 (depcheck: error:
Incorrect number of arguments) if nobody else was working on it.
Tim
13 years