Stash, Pull, Stash Apply as one git command

I noticed that I often do the same sequence of git commands.
run 
notepad ~/.gitconfig
and add
[alias]
spa = !git stash && git pull && git stash apply
Then execute
git spa

Original Post:

With a help of an answer http://stackoverflow.com/a/5401381/52277
I’ve created .bashrc with command
notepad ~/.bashrc
and added the following
 
StashPullApply() {

git stash

git pull

git stash apply

}
Now I can use just the name in git bash
StashPullApply
 Comment from  Daniel Laughland pointed me to alternative methods to do it with pull rebase http://stackoverflow.com/questions/30208928/can-git-pull-automatically-stash-and-pop-pending-changes
Advertisements