Derping with Branches

Because this just tripped me up, and I’d like to think that I’m not the only totally braindead developer out there.

Git is wonderful. You shouldn’t use any other source control. Even if your co-workers don’t get it (It’s because they’re stupid). Disk is cheap, you can afford to keep it all local. It’s fast, it’s flexible, it’s not actually that hard either.

But sometimes you might be trying to fetch a remote branch from your development server. You’ve checked documentation for the syntax and you know you can show your remote branches by issuing git branch -r, and the branch you want isn’t there.

What the Fuck?

Well, it’s actually embarassingly simple and not worth the 5 minutes you spent re-reading the documentation like a cargo-culting toddler whining about how unfair it is he has to eat dinner(“But it says this should wooooooorrrrrkkkkkkk!“).

git pull

.

That’s all. git pull won’t bring across any changes for the current branch (because there aren’t any) but it will bring across metadata changes, like new branches.

FFFFFFFUUUUUUUUUUUU………

 
Share

  1. Or just ‘git fetch’ if you don’t want it to attempt any merging with your current branch.

Leave a Reply