1. Get list of authors
#!/usr/bin/env bash
authors=$(svn log -q svn://url/project | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = ${author} <${author}@email.mu>";
done
git svn clone --authors-file=authors.txt --no-metadata svn://url/project -s
git svn fetch
git svn create-ignore
git add .
git commit -am "Added .gitignore"
git for-each-ref refs/remotes/tags | cut -d / -f 4- | grep -v @ | while read tagname; do git tag "$tagname" "tags/$tagname"; git branch -r -d "tags/$tagname"; done
git for-each-ref refs/remotes | cut -d / -f 3- | grep -v @ | while read branchname; do git branch "$branchname" "refs/remotes/$branchname"; git branch -r -d "$branchname"; done
git config --remove-section svn-remote.svn
git config --remove-section svn
rm -rf .git/svn
Create repository with gitolite.
git remote add origin git@gitUrl:project.git
git gc
git push origin --all
git push origin --tags
ssh -i /c/Users/username/.ssh/gituser.pub git@gitUrl
#!/usr/bin/env bash
authors=$(svn log -q svn://url/project | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = ${author} <${author}@email.mu>";
done
git svn clone --authors-file=authors.txt --no-metadata svn://url/project -s
git svn fetch
git svn create-ignore
git add .
git commit -am "Added .gitignore"
git for-each-ref refs/remotes/tags | cut -d / -f 4- | grep -v @ | while read tagname; do git tag "$tagname" "tags/$tagname"; git branch -r -d "tags/$tagname"; done
git for-each-ref refs/remotes | cut -d / -f 3- | grep -v @ | while read branchname; do git branch "$branchname" "refs/remotes/$branchname"; git branch -r -d "$branchname"; done
git config --remove-section svn-remote.svn
git config --remove-section svn
rm -rf .git/svn
Create repository with gitolite.
git remote add origin git@gitUrl:project.git
git gc
git push origin --all
git push origin --tags
ssh -i /c/Users/username/.ssh/gituser.pub git@gitUrl
No comments:
Post a Comment