git reset --hard
git clean -xdf
mkdir test_repo.git
cd test_repo.git
git --bare init
git clone --recursive <url>
git svn clone <url>
git push origin master --force
git commit -m 'changes to hello file'
git tag -d `git tag | grep -E '.'`
git ls-remote --tags origin | awk '/^(.*)(\s+)(.*[a-zA-Z0-9])$/ {print ":" $2}' | xargs git push origin
Script for creating a bare git repo
#!/bin/sh
if [ -z "$1" ]; then
echo usage: $0 git-repo-name
exit
fi
REPONAME=$1
echo Creating bare git repo $REPONAME.git
mkdir $REPONAME.git
cd $REPONAME.git
git --bare init
You can execute bash scripts remotely via ssh:
ssh <host> 'bash -s' < <name-of-the-script>
This only works well by using ssh-keys for authentication.