I want to only stash all untracked files. I know it can be done with two commands, by first stashing tracked changes and then untracked, but can it be done with one line command
You can do it with alias in ~/.gitconfig:
stash-untracked = "!f() { \ git stash; \ git stash -u; \ git stash pop stash@{1}; \ }; f"
And then just do
git stash-untracked