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
605 questions
0
votes
1 answer

git stash apply can't get the version what i really need

At first branch is in master,then (1) git checkout -b test1 ,then modify one file a.c,and git stash And now git stash list stash@{0}: WIP on test1: 7aa1dbd Merge "RR:AA123" (2)git checkout -b test2,then modify another file b.c,and git stash And now…
liumilan
  • 345
  • 1
  • 4
  • 12
0
votes
1 answer

Recover stashes that were accidentally cleared

This morning while moving quickly from branch to branch, I had to stash my changes. In my haste, I issued a git stash clear -- as my stash list was rather long. In the list of stashes that I cleared was some work I need to recover. Is there a…
rsturim
  • 6,388
  • 14
  • 43
  • 58
0
votes
1 answer

git rebase with stash shows possible duplicate commits

I am using git with git flow, and "dev" and "branches". I worked on a feature baaed on dev, then made some commits in dev. Now I want to rebase my feature on the dev HEAD. Rebase works perfectly, but I also have stashed changes in my feature. When I…
Narretz
  • 4,396
  • 28
  • 37
0
votes
3 answers

My project folder is no longer a Git repository

I am using Git for a project. Up to yesterday night, the repository was up and running and I shut my computer down by the end of the day as I always do. This morning, when trying to run git status from my project folder as I always do, I get this…
Gabriel S.
  • 1,767
  • 1
  • 17
  • 29
0
votes
1 answer

Git stash didn't finish applying

After a stash pop only about 5 of my 50 files were changed. Along with the few changes I got back I got a weird extra file "Y4\004%C2%F8\037UU%BC". I do have a local history in my IntelliJ, so I can probably recover most of it, but is there any…
RasTheDestroyer
  • 1,622
  • 15
  • 21
0
votes
1 answer

Git recover stashed changes after merge --no-ff

I frequently use "git stash" and "git stash pop" to save and restore changes in my working tree. This is what I did and my previous uncommitted changes now are gone. git stash -u git checkout master git pull --rebase git checkout dev git merge…
user43092
  • 363
  • 1
  • 3
  • 7
-1
votes
0 answers

How to git stash push with your own name

What I knew: use git stash push -- fileName to stash specific files (part of all files) use git stash save yourName to specify your own name for the stash item. But how can I push specific files with my own name? I tried git stash push --…
renyinick
  • 1
  • 1
-1
votes
2 answers

git diff shows nothing

After I do a git reset --hard HEAD, I do a git status and everything is clean. Then I do a git checkout stash@{0} -- pom.xml to get the pom.xml file in the stash. When I do a git status it shows modified: pom.xml. When I do a git diff, it shows…
-1
votes
1 answer

How to use `git stash --patch` together with `git stash save`

I want to use: git stash save "Message describing stash" …but I also want to stash only some of my working directory, using: git stash --patch How can I create a stash that both has a message, and includes only selected changes?
George WS
  • 3,381
  • 5
  • 20
  • 37
-1
votes
1 answer

Git stash is changing files contents

Very time I hit git stash it is changing my files to their state in the previous commit. Why is this happing and how did stop this?
-1
votes
1 answer

How to revert back my local changes using Git?

I am working on Git and did lots of changes to a particular file. By mistake, while committing I ran git stash and all changes made to that file are gone now. Is there any way to bring those changes back?? I used git stash show and git stash apply…
user3035566
  • 47
  • 1
  • 1
  • 3
-1
votes
1 answer

After git stashing my project contents are not updated anymore how do I get back all my files

Please, take it easy on me guys, I don't really understand stashing w/git, I only understand git add, status and basic stuff about git, Hope you'd be really understanding with me about this I stashed all my project files since that current changes…
TheBAST
  • 2,280
  • 7
  • 26
  • 53
-1
votes
1 answer

What is the difference between git stash save and git stash store?

Looking for an explanation based on their different use cases.
leafystar
  • 39
  • 1
  • 6
-1
votes
1 answer

Can I prevent git stash pop/apply if I have any file changes?

I broke my own rule of having more than one item in my git stash stack, and I git stash poped two of them instead of one. That means I had two sets of changes, with no conflicts, now sat as untracked changes that I can't separate easily1. So is…
Pureferret
  • 6,477
  • 14
  • 72
  • 149
-1
votes
2 answers

what does git stash save do that git stash does not do and in what circumstance would you use it?

I use git stash a reasonable amount and then git stash pop to re-apply my changes, typically when I want to do a pull from the remote without losing my changes. But I saw the command git stash save being used in a similar manner and after reading…
code_fodder
  • 12,697
  • 10
  • 68
  • 123
1 2 3
40
41