Skip to content

Instantly share code, notes, and snippets.

@batmat
Last active August 29, 2015 13:57
Show Gist options
  • Save batmat/9758569 to your computer and use it in GitHub Desktop.
Save batmat/9758569 to your computer and use it in GitHub Desktop.
git backup (put this in your .git/config or better in your global gitconfig file).
[alias]
backup = "!f(){ git add -A . && git ci -q -m \"WIP backup\" && commit=`git show HEAD|head -1` && git reset HEAD~ && echo \"Backup OK: $commit (or use git reflog)\"; };f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment