I have forked my master code i.e zip/production and created a forked project i.e map/production on gitlab
Now I have made changes to my forked codebase and I want to maintain it that way:
I.e I dont want to touch the additional code present in separate files on my forked repo but I have also made updates on master code and want this to reflect the same on forked codebase without affecting the additional files and code present in map/production.
Its something like forked repo + additional code and the additional code should remain unaffected while bringing in changes from the master repo.
How to go about this?
That will be the case if you commit that additional code in its own branch.
That way, your local clone of your fork can add the original repo as a remote.
You can configure master to pull from that remote:
That would make master push to upstream too, which is not possible, but you are not supposed to push master anyway: you should push only branches created for your modification, not existing branches that can change on the original upstream repo
At any time, you can refresh your master branch (with the content of the original repo)
And at any time, you can rebase your modifications on top of master:
git checkout myBranch git rebase master git push --force
(provided you did push myBranch at least once, with
git push -u origin myBranch)