All pastes #577503 Raw Edit

stash-checkout

public shellscript v1 · immutable
·published 2007-06-19 22:50 UTC
rendered paste body
#!/bin/shset -eNEW="$1"; shiftCUR="$(git symbolic-ref HEAD|sed 's,^refs/heads/,,')"git branch -f "temp/$CUR"git checkout "temp/$CUR"git ls-files --deleted --modified --others -z \    --exclude-from=.git/info/exclude \    --exclude-per-directory=.gitignore \    | git update-index --add --remove -z --stdinif [ "$(git diff HEAD)" ]; then    git commit -m 'TEMPORARY'fiif git rev-parse --verify "temp/$NEW" 1>/dev/null 2>/dev/null; then    git checkout "temp/$NEW"    git reset --soft "$NEW"figit checkout "$NEW"