Skip to content

Instantly share code, notes, and snippets.

@jenslohmann
Created June 8, 2015 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jenslohmann/fa5ab32874d3e442bb5a to your computer and use it in GitHub Desktop.
Save jenslohmann/fa5ab32874d3e442bb5a to your computer and use it in GitHub Desktop.
Git admin for simple newbies
git clone ssh://login@git.server/repo/blah.git
cd blah
git config user.name "Jens Lohmann"
git config user.email "jens.lohmann@mailserver.dk"
svn log http://svn.server/path/to/<project> --xml | grep author | sort -u | perl -pe 's/.*>(.*?)<.*/$1 = /' > authors.txt
vi authors.txt
scp authors.txt login@your.server:
ssh login@git.server
cd /repo
# Only clones trunk and its histrory. Seach the internet for branches and tags
git svn clone --no-metadata --authors-file=~/authors.txt http://svn.server/path/to/<project>/trunk blah.git
# Make it "bare"
cd blah.git
mv .git ..
rm -fr *
mv ../.git .
mv .git/* .
rmdir .git
git config --bool core.bare true
# And make it "shared"
git config core.sharedRepository group
chgrp -R proj .
chmod -R g+w .
find . -type d -exec chmod g+s {} \;
ssh login@git.server
cd /repo
git init --bare blah.git
cd blah.git
# Make it "shared"
git config core.sharedRepository group
chgrp -R proj .
chmod -R g+w .
find . -type d -exec chmod g+s {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment