I have gotten a Github open source project at a good place to share with others (we'll call it Repo A). I'd like to copy the code into a new repo (white label it) called Repo B.
Recap
I need advice on the following:
How can I set up the remotes on Repo B so that when a new feature is introduced on Repo B, I can have it update Repo A? I'm open to have to do this through continuous integration.
With git, having multiple remotes is just as easy as pushing to them!
After creating a repository at GitHub, you are kindly asked to add a "origin" remote to your local repository. (Repo A)
git remote add origin [email protected]/user/repo.git
You can create as many remotes as you like! The synthax is always the same:
git remote add NAME URL
(See The git-remote man page for more information)
After adding Repo B as another remote, you can push the master branch from Repo A to Repo B.
Make sure, you've pulled and got the latest code!
# On the master branch
git checkout master
# Get the latest code
git fetch
# Merge the code from master at repoB
# to your local master branch
git merge repoB/master
# Push the local master branch to RepoA
git push origin master
This should exactly do, what you expect. Make sure to push other branches and tags as well!
(You might use the --mirror
option when pushing)
Update 1:
**Short recap **
After this basic setup, you can repeat this: