https://github.com/mycore-org/svn-migration
project to customize SVN migration to GitHub
https://github.com/mycore-org/svn-migration
documentation github subversion svn-migration
Last synced: about 2 months ago
JSON representation
project to customize SVN migration to GitHub
- Host: GitHub
- URL: https://github.com/mycore-org/svn-migration
- Owner: MyCoRe-Org
- License: gpl-3.0
- Created: 2016-09-27T13:39:38.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2021-03-09T06:33:05.000Z (over 5 years ago)
- Last Synced: 2025-06-23T03:49:14.094Z (12 months ago)
- Topics: documentation, github, subversion, svn-migration
- Language: Shell
- Size: 28.3 KB
- Stars: 0
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: authors.txt
Awesome Lists containing this project
README
# svn-migration
## Check Subversion commit logs
In the [mycore](mycore) subdirectory are some XSLT files that can be helpful to get relevant information of Subversion commit logs. Start there to correct any logs that a not in form `r{revision}`, `rev {revision}`, `rev. {revision}` or `revision {revision}` required for the next steps.
## Create a local Git clone of the Subversion repository
```
mkdir -p git-repos/mycore && cd git-repos/mycore
```
Make sure you use a file system that **does NOT ignore** cases of filenames (e.g. MacOS default).
```
MIGBASEDIR=$(cd ../.. && pwd -P)
svn2git https://server.mycore.de/svn/mycore \
--exclude '.*[/]\.project$' --exclude '.*[/]\.classpath$' \
--exclude '.*\.class$' --exclude '.*\.settings($|[/].*)' \
--exclude '(?!.*[/](src|sources)[/]).*[/]target($|[/].*)' \
-m --no-minimize-url --authors "${MIGBASEDIR}/authors.txt"
```
This monster will initialize a local Git repository in the current directory and uses the author mapping from [authors.txt](authors.txt). It also exluded some accidental commit files and directories.
Now we can finally convert SVN revision to GIT SHA checksums:
```
"${MIGBASEDIR}/filter-branch-date-order" \
--msg-filter "${MIGBASEDIR}/mycore/mycore-msgfilter" \
--tag-name-filter cat -- --all
```
After the initial convertation we need to update the checksum. Look [here](http://www.tt-solutions.com/en/articles/advanced_svn_to_git) further information.
```
"${MIGBASEDIR}/filter-branch-date-order" -f --prune-empty \
--msg-filter "${MIGBASEDIR}/msgfilter-updatesha" \
--tag-name-filter cat -- --all
```
Git saves a backup before rewriting everything in `refs/original`, which we can clean now with:
```
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
git gc --aggressive --prune=all
```
Finally we can put it online
```
git remote add origin https://github.com/MyCoRe-Org/{repository}.git
git push -u origin --all
git push origin --tags
```
Some final cleanup like adding a `README.md` and `.gitignore` file are left to do.