In order to stash untracked file you can use this command
git stash save -u
In order to stash untracked file you can use this command
git stash save -u
In order to update the .gitignore file do the following:
Commit the new .gitignore file.
Run these commands:
git rm -r –cached .
git add .
git commit -m “.gitignore update”
Push on the remote branch.