3

There is an open source project that I'd like to fork for various reasons. The upstream project uses SVN for source code management, but they maintain a read-only Git mirror on GitHub.

I want to take the project on Github and fork it on to Gitlab. One of the most important aspects that I want to be able to do is to merge upstream patches into my fork, but I'm unsure of the best way to go about that? Should I have the master branch track the head branch of the SVN repository and then do all of my development work in a Git branch?

The license the upstream project uses doesn't require changes to be committed back to the main project, but I'd like to keep that option open if possible since I think my changes might appeal to some people in the future once I've tested them on my fork.

I'm just slightly confused about the best way to make sure that I can apply upstream patches to my fork and to make sure that I can merge my changes back to the original project as well if that ever became an option.

1

I would use a separate branch that mirrors exactly the head branch of the SVN repository, besides a master branch that contains the latest release of your fork and any other branches (feature, release, etc.) that are indicated by your preferred branching strategy.

When there is an update from the upstream project, you initially put that in the "upstream" branch, which you then can merge into your main development branch and any active feature branches as needed.

When you want to contribute back, you can make a difference between the "upstream" branch and your main development or master branches to determine what you have added to the project.

  • Thank you for the answer. It was really helpful. – Cromulent Nov 23 '18 at 7:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.