Adam Tarasov
Adam Tarasov

Reputation: 31

GIT: how to stash a file after being edited locally

I've run "git add file" on local file and now I'm trying stash the action.

git status

\# On branch feature/something

\# Changes to be committed:

\#   (use "git reset HEAD <file>..." to unstage)

\#  modified:   utils.py

When I run git diff utils.py response is Empty

How do I stash this changes I've done locally Thanks!

Upvotes: 1

Views: 54

Answers (2)

Adam Tarasov
Adam Tarasov

Reputation: 31

Well it's simpler than I thought,

running command:

"git stash"

will stash changes on all edited/added files in git repository

Upvotes: 2

danglingpointer
danglingpointer

Reputation: 4920

Just use the command git stash “name_of_the_file” this will stash the modified file in the currently checked out branch.

Upvotes: 0

Related Questions