Is it possible to install git to the extent that you have default selections / selections, and if so, how?

I understand that I can use 'git push -u [repo] [br]' to make [repo] the default upstream for the [br] branch.

What I would like to do is set things up so that "git fetch" fetches the changes from one repo for a given branch, and "git push" pushes the changes to another repo for the same branch.

So far, reading man pages and searching here has not changed anything.

The reason I would like to do this is an open source project (not hosted on GitHub), and I created a fork (on GitHub) and would like to extract the project from the open source by default, and by default click on my private plug.

+5
source share
2 answers

See remote.<name>.pushurlin git config . remote.<name>.urlsets your push and fetch location, but if you also specify remote.<name>.pushurl, the first is used only for fetching, and the second for push.

+3
source

The command git remotehas a flag --pushwhen calledset-url

git remote set-url --push <name> <url>

For instance:

git remote set-url --push origin git@github.com:username/repo/project.git

0
source

All Articles