I have two git repos which should be kept in sync and can NOT be accessed at the same time. One is at work and one is at home and there is no network connection possible.
How to handle this simple setup?
What I have tried:
I have a clone which "knows" both repos and exist on a portable harddisk.
Lets say someone has created a new branch at "work" and I want to transfer it to the repo "home". How to do this?
If I only do a git pull
I get the following on my clone:
$ git branch --list --all
*master
origin/HEAD -> origin/master
origin/bugfix_component_condition_destruction_fail
origin/master
origin/remove_stoplist_copy_and_erase
Q: Did this only mean that my local clone "knows" that there are these listed branches somewhere and no real data is on my clone expect for the also local existing one named "master"?
It is easy to pull/push master to both repos. But any other one seems not existing on my local clone. Must I track every remote branch to a local one of my clone and then transfer it to the other repo?
Q: Is there any typical way to deal with two repos to get them both in sync if on both repos commits will be pushed?
Q: Is there a trick to get all infos AND ALSO THE CONTENT of all remote branches.
For me it is a bit misterious what a "clone" of a repo means? It seems not a real clone but only some meta data and the master branch. Is this right?
EDIT:
If I start gitk --all
I see all the changes which are done in the branch. That looks that the content of the branch is in the clone.
But if I do:
$git checkout -b remove_stoplist_copy_and_erase --track remotes/origin/remove_stoplist_copy_and_erase
error: Not tracking: ambiguous information for ref refs/remotes/origin/remove_stoplist_copy_and_erase
Switched to a new branch 'remove_stoplist_copy_and_erase'
So I did:
$git checkout origin/remove_stoplist_copy_and_erase
$git checkout -b remove_stoplist_copy_and_erase
and now push it: $git push --set-upstream ex remove_stoplist_copy_and_erase
I fear to must do all this manually for all branches on both remotes to get the both in sync. Is there some "best practice" for the job?