Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - Pull from one remote repo, push to another: can I push names of remotes?

I wish to use git with multiple remote repos. I have my central git server (aka origin), as well as my local dev machine. What I am trying to do is pull down the latest linux kernel from kernel.org's git repo. I will then make a few changes, and then push the whole modified repo up to my own git server.

I have managed to do this ok (by just doing git remote add a couple of times - ones for the origin and once for kernel.org). However, if I clone origin from scratch, I am unable to see kernel.org as a remote.

Is there a way to push the remote add commands? Or is it that everytime I wish to pull in changes from kernel.org (on a new machine), do I have to manually add it?

Also, when I create my local branch, I made it track a remote branch from kernel.org. Since I can't see kernel.org as a remote on a fresh clone, does this mean that this branch isn't tracking kernel.org anymore?

like image 457
jtnire Avatar asked Aug 18 '12 16:08

jtnire


1 Answers

git push origin --mirror

will push all local refs to origin.

like image 88
senior_citizen Avatar answered Sep 22 '22 06:09

senior_citizen