I have added a new file to my local branch. On running the command git status
it gives below output:
# On branch MyLocBranch
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# mypath/nextDir/myfile.py
nothing added to commit but untracked files present (use "git add" to track)
This is fine as I have untracked file and it shows in red in the terminal.
Now to stash this changes, I ran the commands git stash
and git stash save "some message"
. But I get the error No local changes to save
which is weird. The changes should have been stashed.
By default git stash
doesn't save untracked files.
In order to also stash your untracked files, you can use the --include-untracked
(or -u
) option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With