Search code examples
gitgit-stash

Can I have "git stash" to automatically include untracked files by default?


Well, as the title says, is there an option I can set in git, that will make it automatically include untracked files when I execute git stash, so I don't have to remember the -u option.

Alternately, after I created a stash, and I discover that I forgot to include untracked files, can I amend those to the stash?


Solution

  • I failed to find a configuration option to do this in the git-config manual page ($ man git-config, or $ git config --help, or read it online), but you can get away easily using an alias:

    $ git config alias.stashall 'stash -u'
    $ git stashall