I'd like to take an open source project available on GitHub and use it for a new website. Since it's going to be for private use, I plan on storing the code in BitBucket (since GitHub charges for private repos). But here's what I want to do.
I want to be able to pull from the origin (open source repo on GitHub) whenever I'd like and merge those changes into my project.
I'd like to be able to have my own copy that syncs with BitBucket privately that only I can access.
I'd like to be able to submit pull requests back to the origin on GitHub if I'm able to add any features or fix any bugs that I'm able to.
What's the best way to do that?
I'm thinking I can clone the repository locally, and make a branch of the master branch. I can then setup that new branch to sync to a BitBucket repository. At this point, the master branch will pull from the origin, and my branch will push/pull from my BitBucket branch. This way, I can do all of the work off my own branch, and when changes happen on the master, I can pull those and merge them back into my branch.
I think that would work, but that about my third point on what if I want to submit code to the open source project as a pull request? Wouldn't I need to have that code hosted in GitHub publicly? Is there a better way for me to do this?
I'd like to be able to submit pull requests back to the origin on GitHub
That means:
upstream
in order to fetch any new modifications from the original repoorigin
for "fork
" in order to reference your own fork on GitHUborigin
referencing your private BitBucket repoThat way, you are still being able to: