Skip to content

Instantly share code, notes, and snippets.

@warm-ice0x00
Last active January 8, 2022 20:00
Show Gist options
  • Save warm-ice0x00/4e15729fa442b75a3eb920fefd45d1cf to your computer and use it in GitHub Desktop.
Save warm-ice0x00/4e15729fa442b75a3eb920fefd45d1cf to your computer and use it in GitHub Desktop.
Universal Git Script
#!/bin/sh
[ -z "$1" ] && echo 'No repository URL provided!' >&2 && exit 1
rm -rf .git
git init
git remote add origin "$1"
git add -A
git reset "$0"
git commit -am 'Initial commit'
git push -f origin master
rm -rf .git
echo 'Done! If there is a problem, rerun the script.'
#Inspired by xkcd: Git https://xkcd.com/1597/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment