Reputation: 8211
I really like git
but unfortunately only can submit to a subversion
repository.
Is it possible to work locally with git
with all benefits and submit/checkout from a subversion
repository?
Upvotes: 5
Views: 1648
Reputation: 2647
This just appeared on Hackernews: Working with git on a Subversion project
Using git-svn (Official) you can clone your SVN repository using the command
git-svn clone -s http://example.com/my_subversion_repo local_dir
The -s is there to signify that my Subversion repository has a standard layout (trunk/, branches/, and tags/.) If your repository doesn’t have a standard layout, you can leave that off.
This tracks everything except empty directories as git doesn't track empty directories and svn:ignore
is not ignored in this git repo. To add these files to a .gitignore
file, run the following command.
git-svn show-ignore > .gitignore
You can then use the commands such as git checkout -b new_branch_name [old_branch_name]
for adding branches, git add <filename>
for adding files, git checkout <filename>
for reverting changes and git commit -a
for committing changes as you would normally use git.
Before committing back to svn, you will want to rebase any changes using git-svn rebase
and then to push your commits back to svn you will use git-svn dcommit
(Delta Commit).
Upvotes: 0
Reputation: 12121
You might find this ProGit chapter particularly useful.
One of Git’s great features is a bidirectional bridge to Subversion called git svn. This tool allows you to use Git as a valid client to a Subversion server, so you can use all the local features of Git and then push to a Subversion server as if you were using Subversion locally.
Upvotes: 2
Reputation: 8488
This just appeared on Hackernews: Working with git on a Subversion project
Upvotes: 0