Questions tagged [git-stash]

Allows to move pending changes in a working git directory away and restore them later, i.e. put them on a stash. You can have multiple stashes and it can also be used to move pending changes to another branch.

git stash allows you to stash changes in working directory, and then restoring them later, possibly on another branch.

Stashing changes is usually necessary when you need a clean working copy, e.g. before using or .

Popular questions

See also

References

$ git stash --help
675 questions
0
votes
1 answer

Local repository upgrade

Some time ago I installed Galaxy application on my server machine. Since there is new release, I wanted to upgrade it and I use command: git checkout release_17.05 && git pull --ff-only origin release_17.05 but I got error message: Already on…
Marija
  • 3
  • 3
0
votes
1 answer

Why does git stash pop acts as apply

Anybody know why the drop part of the pop would not work for me? pop is behaving like apply. My process is: git stash save "name of save" git stash pop then: git stash list (and "name of save" will still be listed). enter image description here
0
votes
1 answer

Git - disable custom filters when stashing

I've got a custom filter in .git/config to remove lines marked: # todo. [filter "removetodo"] clean = "sed '/\\ *#\\ todo/d'" Plus *.py filter=removetodo in file .gitattributes. Works nice, I can use git add -p without looking at a lot of my…
Ctrl-C
  • 4,132
  • 1
  • 26
  • 29
0
votes
1 answer

Is git stash/git stash pop okay for accidental branch switch?

Are git stash and git stash pop a good solution for this problem? I was working on branch B, but something happened accidentally and unbeknownst to me, put me back into an older branch, branch A, where I kept working blindly on various tasks. Git…
bunnycode
  • 275
  • 2
  • 14
0
votes
1 answer

Git: Simulate git stash without stash command

Git stash is a very helpful family of commands but it does not add anything to the commands (i.e. you can't commit without the commit command, while you can have workarounds to stash with no stash command). How would you do it if you had to stash…
gioaudino
  • 573
  • 8
  • 23
0
votes
1 answer

How to hit the rest endpoint that has `:.*` as a part of the path param field

I am using the Stash's REST API in my project. My task is to get the tag details for a specific tag. After checking the Stash's REST API documentation, I found the correct endpoint that I should be using. It is…
RITZ XAVI
  • 3,633
  • 1
  • 25
  • 35
0
votes
2 answers

Can't cancel my update

I have a question about git command. I tried to cancel my update from git stash. But i wasn't able to do it. I use the following command. ~/xxxxx-repo on  master! ⌚ 18:27:45 $ git checkout . …
0
votes
0 answers

Issue in conflict in stash

This is my scenario I did change on file a. I created new file b do stash do change in file a. do commit do use stash call to get status -> get only one file in conflit but I didn't get the file untracked b. It is occured only in this scenario…
user1365697
  • 5,819
  • 15
  • 60
  • 96
0
votes
2 answers

`git stash apply` deleted a random dir from my working copy

I just tried git stash save for the first time. It worked fine. Then I tried git stash apply and while my uncommitted changes were restored, another effect was that a random dir from the root of my working copy was deleted. I don't know why it chose…
Stefan Monov
  • 11,332
  • 10
  • 63
  • 120
0
votes
1 answer

git stash unresolved merge conflicts

I was resolving merge conflicts and needed to get back to the old codebase to figure out how it worked before. I intuitively stashed my working copy, checked what I wanted to and applied the stash back. Now I'm in a lot of trouble because my code…
yuranos
  • 8,799
  • 9
  • 56
  • 65
0
votes
1 answer

git stash apply does not restore all the files

Ok, so i have run into this a few times and it's really annoying. Scenario: modify a file say a.txt (add say two lines) stash it stash apply git reset remove the two lines added to a.txt because you want to commit and push these partial …
Coder
  • 1,375
  • 2
  • 20
  • 45
0
votes
1 answer

Apache tomcat doesn't recognize git stashed and later git stash applied changes

I had a repository with code that I was testing via running a server at localhost. The standard procedure was to start Apache-Tomcat-7, re-build the project using Maven and deploy it. After a while of coding I decided to git stash current changes,…
petajamaja
  • 520
  • 2
  • 9
  • 26
0
votes
2 answers

Git stash possible to apply stash created by another user?

I want to share my stash with my friend and looking for ways to "upload" my stash to the git repo so that he/she can "download" the stash. Is that possible and if yes, how to do it?
Nam G VU
  • 33,193
  • 69
  • 233
  • 372
0
votes
1 answer

Why git pull won't/can't merge local changes?

Trying to understand git behavior. When I execute git pull I get a warning error: Your local changes to the following files would be overwritten by merge: foo/bar Please, commit your changes or stash them before you can merge. Aborting But…
Chaim Geretz
  • 826
  • 5
  • 23
0
votes
1 answer

Is there any way to get in what stash a certain file was added/changed?

I know somewhere in my stashes, there is an specific file with some changes I want to recover, but I don't know in which one. Is there any way to know in what particular stash is this file?. I know about git stash show -p, but that is slow, going…
Artemix
  • 8,497
  • 14
  • 48
  • 75