I had git cloned the MapBox-ios-sdk project. I’ve made a few ugly hack changes to the code that was not appropriate to contribute back. But MapBox-ios-sdk changed recently. If I want to merge their latest changes to my project while still maintaining my hack, what’s the best practice about doing that with Git? Should I have branched initially when I cloned? Or should I just modify in the master branch and just git pull from the official source and resolve conflict, and keep it at that for future sdk version as well?
Share
I’m going to assume that your hack has been committed to your local
masterbranch. You can move it to a branch by doing something like:This will give you a
myhackbranch with your one commit on it (adjustmyhack^if there is more than one commit), and amasterbranch that matches the original master from the project.At this point, you can pull new code into your local
masterbranch without conflict. Then, switch to yourmyhackbranch and merge the new master in: