Reputation: 18655
I'm trying to setup a repository so that I can pull both from GitHub
and a company internal repository but push
(by default) only to the internal one and I'm confused about the proper steps I should take.
It looks like there are two approaches:
GitHub
by using --allow-unrelated-histories
(will it require me to always use this switch or is it a one-time sync?)GitHub
repository and add a new upstream remote pointing to the internal repo that I would then use for push
ing.Upvotes: 0
Views: 26
Reputation: 2689
The second option is more correct.
Clone the Repository from Github and this branch will be automatically set as origin
branch.
Add the Internal remote branch as upstream by command:
git remote add upstream <url_of_repo>
When pulling do this:
git pull origin <branch-name>
while pushing do this:
git push upstream <branch-name>
This the normal git flow and I don't think there will be any disadvantages of this flow.
I hope it helps!
Upvotes: 2