Skip to content

Miscellaneous commands

Josh Soref edited this page May 2, 2021 · 1 revision

Miscellaneous commands

Empty remote

#!/bin/sh
if [ -d ~/code/empty ]; then
  cd ~/code/empty
else
  cd $(mktemp -d)
  git init
fi
for a in $(git ls-remote $1|perl -pne 's/^\S*\s+/:/'); do git push $1 $a 2>/dev/null & done

Adding another remote

git remote add $ORG -t $BRANCH --no-tags $(git remote get-url origin |perl -pne 's{:.*/}{:'$ORG'/}')
Clone this wiki locally