I've cloned a project's sources using Git, which is converted on the server from a SVN repo. The problem with this Git repository is that it lacks tags, branches, and some revisions are missing. The number of revisions is enormous (~20000) for me to use git-svn clone, and it'd be a waste of bandwidth and time as I already have most objects in my local repo. Because of this, I'd like to know:
You can clone a subversion repository to your machine using git svn clone <SVN repo URL> . The code will be available as a git repository. You can do your work there and make local commits as you please. There is a command line option to get a "shallow" checkout rather than the entire repository which is often useful.
Normally, the "git svn clone" and "git svn rebase" commands attempt to recreate empty directories that are in the Subversion repository. If this option is set to "false", then empty directories will only be created if the "git svn mkdirs" command is run explicitly. If unset, git svn assumes this option to be "true".
The difference between Git and SVN version control systems is that Git is a distributed version control system, whereas SVN is a centralized version control system. Git uses multiple repositories including a centralized repository and server, as well as some local repositories.
You can clone from a SVN repo using the git svn clone command. -s = If your SVN repo follows standard naming convention where main source is in “trunk”, branches are created in “branches”. Here we are telling git svn that trunk is the “trunk” directory, maintenance is the “branches” directory etc.
Letting git-SVN take over your clone is easy; just run git svn init
with the same arguments you used in the original repo and then your git svn fetch
should find the existing commits in the repo.
Adding the branches can't be done without serious repo surgery: you'd have to rewrite much of your history to include the cross-branch merges.
Pulling tags in is easy and I believe can be done after the initial repo clone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With