Skip to content

Instantly share code, notes, and snippets.

@tobyS
Created January 29, 2014 07:59
Show Gist options
  • Save tobyS/8683629 to your computer and use it in GitHub Desktop.
Save tobyS/8683629 to your computer and use it in GitHub Desktop.
Git commands to stash, pop stash & rebase by default. Just put the files (with the given names) into a bin-dir and make them executable. The use e.g. "$ git spush" instead of "$ git push".
#!/bin/bash
STASH_RESULT="`git stash`";
git pull --rebase
if `echo "$STASH_RESULT" | grep -q 'Saved working directory'`
then
git stash pop
fi
#!/bin/bash
STASH_RESULT="`git stash`";
git pull --rebase && git push
if `echo "$STASH_RESULT" | grep -q 'Saved working directory'`
then
git stash pop
fi
#!/bin/bash
STASH_RESULT="`git stash`";
git rebase -i
if `echo "$STASH_RESULT" | grep -q 'Saved working directory'`
then
git stash pop
fi
@tobyS
Copy link
Author

tobyS commented Jan 30, 2014

Looks nifty, too. However, I'm quite used to the git <command> schema and the loose s disturbs that a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment