SkyrimForge.com
Mods
Authors
Forums
Wiki
Store
Paste
Sign in
Register new account
SkyrimForge.com Wiki
Repositories
/
Convert SVN to GIT
r1
Source
Markup:
==Converting a SVN repository to GIT== Note: You may need to use git-svn on Linux as there are reports that it is broken on Windows clones. # Develop an author map file which contains the lines for each user who has submitted a commit to your SVN repository: svnuser = R. E. Alname <real@email.com> # Run the following command to import the SVN repository into a GIT repository: git svn clone -A author-map --no-metadata -s svn://svn.url.com/game/project/mainline project # Fix up the history until satisfied. # Change the repository on the web-page to GIT. # Run the following commands to add your GIT repository: git remote add origin git@git.url.com:game/project/mainline.git git push origin master ==How to fix the history== ===Remove useless commits=== ====Transition from old repository to new repository==== # Make a graft that removes the commits that you do not want. ====Remove the project name from commit notes==== On the old repository, you had to preface all your commit notes with the project name. This will get rid of them all. # Run the command: gfb: git filter-branch --tag-name-filter cat --msg-filter 'perl -pe "s/^project:\s*//"' -- --all ===Create a tag for the branches=== # Run the following command: g for-each-ref --format="%(refname)" refs/remotes/tags/ | while read tag; do if git diff --exit-code $tag^ $tag; then GIT_COMMITTER_DATE="$(g log -1 --pretty=format:"%ad" $tag)" GIT_COMMITTER_EMAIL="$(g log-1 --pretty=format:"%ce")" GIT_COMMITTER_NAME="$(g log -1 --pretty=format:"%cn")" g tag -m "$(g log -1 --pretty=format:"%s%n%b" $tag)" ${tag#refs/remotes/tags/} $tag^; fi; done **Have alias g=git The net effect is to tag, for each svn "fake tag" branch $ref, the parent $ref^ ''if'' there are no changes in the tag commit itself (in which case it is superfluous), preserving the tagger identity and timestamp in the process
Markup Type:
The type of markup for this entry.
Click here for details
.
BBCode
Curse Wiki (Deprecated)
Markdown
Plain Text
Safe HTML
WikiCreole
<div><img src="//secure-us.imrworldwide.com/cgi-bin/m?ci=us-603339h&cg=0&cc=1&ts=noscript" width="1" height="1" alt="" /></div>