Sha256: 979d95584ac8700e2cd56a5f24706749906b0ff4baa8e36f8989c240df018845
Contents?: true
Size: 503 Bytes
Versions: 36
Compression:
Stored size: 503 Bytes
Contents
#!/bin/bash # # git-stash-and-checkout -- # # Push to the stash, checkout, and pop the relevant WIP stash. # die() { echo "$@" ; exit 1 } head=$(git symbolic-ref HEAD 2> /dev/null || git log -1 --format=%h) current_branch=${head#refs/heads/} target_branch=$1 git stash --include-untracked || die git checkout $target_branch || die stash=$(git stash list | grep "WIP on ${target_branch}:" | head -1) stash=${stash%%:*} if test -n "$stash" ; then echo "Popping $stash" git stash pop $stash fi
Version data entries
36 entries across 36 versions & 1 rubygems