kieranpotts / dotfiles

My UNIX dotfiles.
MIT License
1 stars 0 forks source link

Git "stash" aliases #237

Open kieranpotts opened 1 year ago

kieranpotts commented 1 year ago

The stash is a lightweight holding area, intended for temporarily moving changes out of the working area, to be restored a short time later.

I think this stashes the working changes:

[alias]
        stsh = !CURRENT=$(git symbolic-ref HEAD) && git symbolic-ref HEAD refs/heads/stash && git commit -a -m stashed && git checkout $CURRENT

Others:

    sa = "!sh -c \"git stash apply 'stash@{$1}'\" -"
    sp = "!sh -c \"git stash pop 'stash@{$1}'\" -"
    ss = "!sh -c \"git stash save -u $1\" -"
    sl = stash list