So, first thing you have to remember is that modern English is a super weird language that has its roots in 3 different languages and easily imports words from other languages (but doesn't modify the spelling to fit existing rules).
In English, generally, when you have a G followed by a vowel which is then followed by a consonant, the hard sound is used like Girafe, Gift, and Guffaw use the hard G sound.
But there's also Gin, Gem, Gym, Geo, and Gel. Words that have a G, then a vowel, then a consonant that uses the soft G sound (interchangeable with a J). What's the deal with those?
Funny story: those words come from other languages. When they entered the English language, no one bothered to change their spellings to reflect how they're pronounced!
But why is GIF a hard G and not a soft G? Because it's an acronym, and English Acronyms tend to follow the root word pronunciations. Graphic Interchange Format. Graphic is a hard G.
So GIF uses a hard G.
But why would anyone use the soft G?
Because Steve Wilhite of CompuServe, when deciding on the pronunciation, said he deliberately chose to echo the American peanut butter brand, Jif, and CompuServe employees would often say “Choosy developers choose GIF(jif)”, playing off of Jif’s television commercials.
Anyone using that soft G sound is trying to show off how much history they know by being hipster developers.
Don't be a hipster developer, use the Hard G.