Last active
November 26, 2018 15:13
-
-
Save fearphage/dca33cb86e9e7d45d8dadf2b48cea4a9 to your computer and use it in GitHub Desktop.
When you need to save the code before you save yourself, git fire.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
fire = !"f() { \ | |
local current_branch=$(basename \"$(git symbolic-ref HEAD)\"); \ | |
local new_branch=fire-${current_branch}-$(git config user.email)-$(date +%s) \ | |
local message; \ | |
if [ -z \"$1\" ]; then \ | |
message=\"fire commit from $current_branch\"; \ | |
else \ | |
message=\"$*\"; \ | |
fi; \ | |
git checkout --branch \"$new_branch\"; \ | |
cd \"$(git rev-parse --show-toplevel)\"; \ | |
git add --all; \ | |
git commit --no-verify --message \"$message\"; \ | |
for remote in $(git remote); do \ | |
git push --set-upstream \"$remote\" \"$new_branch\" || true; \ | |
done; \ | |
echo \"\\n\\nFully commited. Now git out!\\n\"; \ | |
}; f" |
Needs sunglasses in there somewhere
sunglasses () {
echo -en " ( •_•) \r"
sleep .5
echo -en " ( •_•)>⌐■-■\r"
sleep 1
echo " (⌐■_■) "
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@fearphage What if the git server caught on fire too ?