Cloning of Local Repository (git-svn)
Context
In some cases it takes days time to convert a large Subversion to a local Git repository using git svn clone <svn-url>.
So the plan is to use that Git repository as a Git remote and intermediate to Subversion.
The reason it takes so long is that the Subversion repository needs to be cloned from the start to be successful in many cases.
At the Git-SVN Repository
This side is in this story is called 'remote'.
The branch needed is hotfix.
Show at the Subversion cloned Git repository all the branches located in the subdirectory git-svn-repo.
* master
remotes/origin/hotfix
remotes/origin/tags/v0.0.0
remotes/origin/tags/v0.0.1
remotes/origin/trunk
The Git config shows the connection between branches and Subversion
svn-remote.svn.url=https://<svn-host-domain>/svn/myrepo
svn-remote.svn.fetch=trunk:refs/remotes/origin/trunk
svn-remote.svn.branches=branches/*:refs/remotes/origin/*
svn-remote.svn.tags=tags/*:refs/remotes/origin/tags/*
Checkout the needed branch hotfix here as well to allow a push when used as a remote.
hotfix branch is created.
* hotfix
master
remotes/origin/hotfix
remotes/origin/tags/v0.0.0
remotes/origin/tags/v0.0.1
remotes/origin/trunk
Creating the Remote Repository
This side is in this story is called 'local'.
Creating empty local Git repository called myrepo.
mkdir -p myrepo
# Initialize empty repository.
git -C myrepo init
# Add remote called origin.
git -C myrepo remote add origin "<directory-to-git-svn-repo>/.git"
Show all branches on remote origin.
0a2f27dfa1cb959aa5f94a2cc8ebdac93a173583 HEAD
0a2f27dfa1cb959aa5f94a2cc8ebdac93a173583 refs/heads/hotfix
96554c3a59c2414e780ce17e55c8cebad07151ae refs/heads/master
0a2f27dfa1cb959aa5f94a2cc8ebdac93a173583 refs/remotes/origin/hotfix
e254a7ddd7b97f1ffa3ec8b244821bb4128be299 refs/remotes/origin/tags/v0.0.0
81374d15071c6d858f744ca8694c94206351c52f refs/remotes/origin/tags/v0.0.1
96554c3a59c2414e780ce17e55c8cebad07151ae refs/remotes/origin/trunk
Remote
refs/heads/hotfixis available because of thecheckoutat the 'remote' earlier.
Fetch a branch hotfix which is here named local-hotfix as a local branch.
Check if the branch exists.
The tracking remote branch is not visible yet.
To make that happen the next command is needed.
Reports...
Show how things are configured for remote named origin.
Show the tracking upstream per branch.
Operation
At multiple local Git repositories commits can be made and pushes can be performed on the remote.
On the remote the command git diff origin/hotfix the differences ar shown between the current Subversion side.
Some commands in logical order that could apply...