Why Are There Two Pronunciations For ‘G’?

On phonetic grounds, a case can be made for either pronunciation. In English, words beginning with ‘g’ can have a soft (giraffe) or hard (give) pronunciation, and therein lies the problem. Why are there two g’s? And are there any rules governing…