I am new to git, and have a subversion repository that I want to be able to import into a git repository occasionally (for deployment). So I want to perform most of the updates using svn but wanted to see what’s the best way to push it to git (just the default/master branch).
Share
I know you only want to import the master/trunk branch of your svn repository, but I would like to mention svn2git in order to import your svn into a git repository.
It is better than
git svn clonebecause if you have this code in svn:git-svnwill go through the commit history to build a new git repo.It will import all branches and tags as remote svn branches, whereas what you really want is git-native local branches and git tag objects.
So after importing this project, you would get:
After svn2git is done with your project, you’ll get this instead:
Finally, it makes sure the HEAD of master is the same as the current trunk of the svn repo.