Is there a way to use some git clone / fetch mechanism to keep the repo in my clone up to date including all refs/remotes/ from the remote?
This has nothing to do with git fetch --all
, git pull --all
or git svn
. It's just about copying the remotes of a remote to a clone.
A command like this would be great:
git clone --include-remote-remotes git@linuxmachine:TheGitSvnClone
And then periodically
git fetch --update-remote-remotes origin
Some Details:
The remote has its own remote named svn which contains some branches:
As a result of the clone I'd expect a normal git repository including a working copy (checked out files) and the following refs:
I can't use git clone --mirror
because that creates a bare repository.
Why so complicated?
Our company is currently using svn. Meanwhile I'm preparing the migration from svn to git.
Unfortunately git svn fetch
takes forever on my windows machine so I'm using a linux machine that does the git svn fetch
periodically and then I copy the resulting git repo using FileZilla.
After cloning the repository normally, instruct Git to fetch the remote refs:
git config --add remote.origin.fetch '+refs/remotes/svn/*:refs/remotes/svn/*'
Subsequent git fetch
calls will download the svn
refs.