I have bought (licenced) some code from Codecanyon that is not maintained in GIT. I have now made quite a few changes to it (using GIT). Pretty soon the authors of the original code will release a new version. I will want to incorporate their changes without losing my own. I would therefore like to load their code and get GIT to point out conflicts so that I may be able to (hopefully) incorporate the new code into mine. Can anyone recommend a safe way of achieving this please? Thanks.
If you have, in your local repo, a commit with the first version of their code :
$ git log --graph --oneline
1234ee * (HEAD -> master) my latest changes
1234dd * added a feature
...
1234aa * a commit, with the initial version of the product's code
...
You can :
git checkout -b upstream 1234aa
# to be thorough : you should delete files which existed in the first version,
# and do not exist in the new version
git rm -- [list all files of original archive]
# for example, here is one way to drop all versioned files :
git rm -- "*"
# extract the files from the new version :
tar -xzf newversion.tgz
# add and commit :
git add .
git commit -m "new version"
upstream in your local branch :git checkout master
git merge upstream
It's not so good to mix git with non-git projects and maybe this is opinion based, but this is what I would do:
masteror main branch as you whish to call it.next (you choose tha name)master when they work properly.master, then create a branch thirdParty and replace its content with the new release (this is where it gets ugly).thirdParty with master or b) master with thirdParty. This can be very messy taking in count that their modifications must be huge, so I'd choose b).If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With