-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding README and license information.
- Loading branch information
James
committed
May 5, 2008
1 parent
635c136
commit ea4f836
Showing
2 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2008 James Coglan | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
== svn2git | ||
|
||
+svn2git+ is a tiny utility for migrating projects from Subversion to Git while keeping | ||
the trunk, branches and tags where they should be. It uses git-svn to clone an svn repository | ||
and does some clean-up to make sure branches and tags are imported in a meaningful way, and | ||
that the code checked into master ends up being what's currently in your svn trunk rather | ||
than whichever svn branch your last commit was in. | ||
|
||
=== Examples | ||
|
||
Say I have this code in svn: | ||
|
||
trunk | ||
... | ||
branches | ||
1.x | ||
2.x | ||
tags | ||
1.0.0 | ||
1.0.1 | ||
1.0.2 | ||
1.1.0 | ||
2.0.0 | ||
|
||
git-svn will 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 I'll get: | ||
|
||
$ git branch | ||
* master | ||
$ git branch -a | ||
* master | ||
1.x | ||
2.x | ||
tags/1.0.0 | ||
tags/1.0.1 | ||
tags/1.0.2 | ||
tags/1.1.0 | ||
tags/2.0.0 | ||
trunk | ||
$ git tag -l | ||
[ empty ] | ||
|
||
After svn2git is done with your project, you'll get this instead: | ||
|
||
$ git branch | ||
* master | ||
1.x | ||
2.x | ||
$ git tag -l | ||
1.0.0 | ||
1.0.1 | ||
1.0.2 | ||
1.1.0 | ||
2.0.0 | ||
|
||
Finally, it makes sure the HEAD of master is the same as the current trunk of the svn repo. | ||
|
||
=== Installation | ||
|
||
Make sure you have git installed, then install the gem: | ||
|
||
$ sudo apt-get install git-core git-svn | ||
$ sudo gem install svn2git | ||
|
||
=== Usage | ||
|
||
To create a git repo from an existing svn repo: | ||
|
||
$ svn2git http://svn.yoursite.com/path/to/repo | ||
|
||
This will create a new directory called +repo+ containing the git version of the repository. | ||
If you're not using the standard trunk/branches/tags layout, you can pass arguments to tell | ||
git-svn what to look for: | ||
|
||
$ svn2git http://svn.yoursite.com/path/to/repo trunk=the_trunk tags=taggings | ||
|
||
=== GitHub integration | ||
|
||
When creating your new git repo, svn2git can push your new repo to github.com if you pass | ||
in your username and project name. For example: | ||
|
||
$ svn2git http://svn.jcoglan.com/packr github=jcoglan/packr | ||
|
||
You need to make sure the project exists on github before running this, and make sure you | ||
have your SSH key set up or this won't work. | ||
|
ea4f836
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename README -> README.md pls