0

I really need your help here.

I have a project that's based on an open-source solution hosted on Github. I need to be able to change files as required for my company, but at the same time sync the code with the original repo to keep it updated.

So I need something like

(get-latest-remote-repo-code --> apply-my-specific-adjustments --> production)

What's the most sensible way to achieve this? How would you handle this situation?

Pavel Lint
  • 3,252
  • 1
  • 18
  • 18
  • 1
    I would have multiple remotes. One called `origin`, a remote within my company where I push to regularly, and one called `upstream` where I fetch updates incase the open source repo updates. – evolutionxbox May 31 '18 at 09:01
  • @evolutionxbox will it work if I'm a number commits ahead after my modifications? – Pavel Lint May 31 '18 at 09:06
  • 1
    It should do... that's why we merge, or even `pull --rebase`. – evolutionxbox May 31 '18 at 09:07
  • Also keep your local branches separate from the upstream (using evolutionbox's naming) branches. Then merge from upstream/master to origin/ourMaster. – Richard May 31 '18 at 09:23
  • 1
    Possible duplicate of [How do I update a GitHub forked repository?](https://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository) – phd May 31 '18 at 09:27

0 Answers0