Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Two shell functions to store/restore the working tree - for use between multiple computers
git-store() {
branch=$(git rev-parse --abbrev-ref HEAD)
git checkout -b save-point && git add --all && git commit -m "save point" && git push origin save-point && git checkout "$branch"
}
git-restore() {
branch=$(git rev-parse --abbrev-ref HEAD)
git checkout save-point && git reset HEAD@{1} && git checkout "$branch" && git push origin :save-point && git branch -d save-point
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.