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

Lost changes after stash+pop with Git

Here is my problem: After doing some changes in my project, I executed git stash, but I did not execute git add . before. I then removed one folder I was working in before doing git stash. Finally, when I wanted to pop the changes I found that the…
Mustansar Saeed
  • 2,730
  • 2
  • 22
  • 46
0
votes
1 answer

Is "git clean" followed by "git stash clear" redundant when creating a pristine checkout?

I would like to write a script that guarantees a successful Git checkout without intervention from the user. I don't mind dumping anything that cannot be solved without user intervention: for example, uncommitted changes. I do want to keep…
lofidevops
  • 15,528
  • 14
  • 79
  • 119
0
votes
1 answer

Strange git file created during stashing

Recently after stashing changes in git, I noticed a strange file named "s" in the root directory of my project. It looks like some kind of corrupted git diff. What might have caused this? How can I prevent it from occurring again? [1mdiff --git…
Zach
  • 1,291
  • 2
  • 13
  • 21
0
votes
1 answer

Git stash / detached head

I have had a dirty state in my project, which I did not want to commit. I did a git stash, to save it for later. Afterwards I continued and did some commits. The project now is in detached HEAD mode. Now, I do not care about the stashed changes…
andreas
  • 1,483
  • 1
  • 15
  • 36
0
votes
1 answer

what is the right way to git stash pop?

I git stash my changes, then I pick the updates up using git stash pop, but the gitk still shows the stashed version, what is the right way to pick up the updates?
user2131316
  • 3,111
  • 12
  • 39
  • 53
0
votes
1 answer

Git stash and git pull in vagrant

Having problem in using git pull and git stash it give me following error. fatal: cannot unlink '.vagrant/machines/default/virtualbox/id': Permission denied Inside vagrant and if I use git pull then it will say that there some changes that need to…
railsman
  • 132
  • 2
  • 14
0
votes
3 answers

Making clean commits from a mess of changes in the working tree

Sometimes I end up with a working tree with a lot of changes, mainly after coding in a hurry - the changes are so many that could fit in 20 commits, spread across 2 or three branches. To clean up the working tree and commit everything nicely, I…
CamilB
  • 1,377
  • 1
  • 12
  • 27
0
votes
1 answer

Applying several stashes without commiting

Is there anyway to apply various stashes in my currently checked out branch without having to do commits (and eventually resetting HEAD) in the process?
talles
  • 14,356
  • 8
  • 45
  • 58
0
votes
2 answers

Why does Tools->Git->Stash fail in Qt Creator where Tools->Git->Undo Uncommitted Changes does not?

Sometimes git stash fails even though I can manually make a backup of the project folder with the uncommitted changes, and then call "Undo Uncommitted Changes". This happens, for example, if I add a new file foo.cpp to my project. When I want to…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
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
  • 365
  • 1
  • 4
  • 13
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,756
  • 15
  • 47
  • 59
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,769
  • 32
  • 40
0
votes
4 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,961
  • 2
  • 20
  • 30
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,756
  • 16
  • 22
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 2 3
44
45