Git Conflicts in your Binary Files

Your team is behind schedule. You are supposed to have shipped 3 days ago. You have a groupon for the latest Superman movie and it expires tonight! Your dog hasn't been out yet and she is known to pee all over your roommate's bed! By your independent calculations the Aztec calendar shows tonight is the night where the planets align just right to point out the site of Montezuma's golden tomb!

All you need to do is merge these two git branches and you are home free.

$ git commit -m 'last testsuite written, i am home free'
$ git push origin feat_complicated_codes
$ git checkout deploy_branch
$ git merge feat_complicated_codes
   CONFLICT

No one likes git conflicts. It is even worse if the conflict is on a binary file. Open it up in vim and you cant tell one character from another. Don't fret though. You won't need to parse through binary garbage and select the correct characters. You also won't need to look for some random git command or attempt to remember whether you should reset, revert or rebase what you just did. Just do a normal checkout of the version that you want with an added "--ours" or "--theirs" tag. The syntax is simple. Pick the file you want and you are home free. Another reason to love git.

$ git checkout --ours -- path/to/binary_crap.bin
$ git checkout --theirs -- path/to/binary_crap.bin
images/git-conflict.jpg

Comments !

About

Started writing one year ago, the day after heading out to travel around the world for a year without a cause.
Current Location: New York, New York

Previously:
Mexico City, Mexico
Tokyo, Japan
Hanoi, Vietnam
Vientiane, Laos
Phuket, Thailand
Kathmandu, Nepal
Rajastan, India
Kerala, India
Mumbai, India
Freetown, Sierra Leone
Koidu, Sierra Leone
Mombasa, Kenya
Nairobi, Kenya
Kigali, Rwanda
Rwinkwavu, Rwanda
Boston, MA

Latest Posts

Port Forward an old Airport Express

If Developers Took Steroids

We Need Elon Musk

Crossword Scraper

Git Conflicts in your Binary Files

Japanese Sidewalk Interfaces

Introducing Kickbacker

Real Life: Google Glass Done Wrong

Tux Trashcans

How Angry are your Developers?

A 500 Startups Model for the Art World

Unsubscribe from Black Friday/Cyber Monday

Copyrighting Art into Obscurity

Crack WiFi Passwords with aircrack

Using Sandy as an Excuse to Email Spam Customers