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
4 answers

Go back to original branch after git stash

I wanted to check a previous commit. I am in brach mybranch where I had a few changes in a file, that's why I did git stash first. Then, git checkout previouscommit I ran the code, made a few changes that I don't want to save. Now, how can I go…
George
  • 5,808
  • 15
  • 83
  • 160
0
votes
1 answer

Error while creating new Jenkins job: Failed to connect to repository : status code 128

I am new to Jenkins, I am trying to create a Jenkins job using web client. It shows following error: Failed to connect to repository : Command "git ls-remote -h https://user.name@atlstash.corp.bayadv/scm/qa/qa-auto-framework-selenium.git HEAD"…
amit
  • 181
  • 2
  • 4
  • 20
0
votes
2 answers

I accidentally "git stash" all my changes. How do I roll back?

I am new to programming and new to github. I am currently doing my intern at a school department. I installed some js plugins today and realized I might have wiped out some of the other js files. Then I decided to just copy the .cshtml and .css…
Patrick Mao
  • 1,013
  • 1
  • 8
  • 12
0
votes
1 answer

Using stash and eclipse, I cannot see a branch I created in the Stash UI in the git view in eclipse

So I created a branch in the stash UI but I cannot see it on the list of Remote Tracking branches in the Git Repositories eclipse add-on. Thanks in advance for the help!
0
votes
2 answers

switch between branches, preserving the stash?

Sometimes I could use an equivalent of git stash && git checkout $branch && git stash pop that would remember what was the state of the tree for a given branch and only restore the one that was stashed for this particular branch. How could easily…
d33tah
  • 10,999
  • 13
  • 68
  • 158
0
votes
1 answer

Can deleting the Git stash conceivably delete folders in the working directory?

I recently deleted the many-months-old stash of a Git project I hadn't worked on for a few months. Without reviewing it, I know m-) Upon compiling the project about 30min later, several folders and file were missing. Pretty surely I didn't…
Katrin Leinweber
  • 1,316
  • 13
  • 33
0
votes
1 answer

Anyway of restoring local changes before pull

I was working on some files locally and was behind the master branch. So before continuing, I pulled so I can work on these files while not being too far behind the master branch (I hadn't committed as the code I was working on was not finished). So…
tinOfBeans
  • 707
  • 1
  • 9
  • 22
0
votes
0 answers

resolve error : "commit your changes or stash them before you can switch branches"?

I was on master branch which had following files in staging area : modified: app/assets/stylesheets/login.css modified: app/controllers/application_controller.rb modified: app/controllers/users_controller.rb modified: …
Parth Pandya
  • 39
  • 1
  • 12
0
votes
1 answer

Search for a string under src using shell script

I basically wanted to search for some sql stored procs in the code. For Eg: video.sf_get_video_topology , video.sf_get_vod_entitlements, video.sf_get_account_service_cd etc. There are a lot of files and folders under src. I basically wanted to…
Jeel
  • 2,227
  • 5
  • 23
  • 38
0
votes
1 answer

Did a Git add, stash and pop. Failed to restore my changes

I am on branch1 --> did some changes --> did a git add, then did a git stash save --> switched to branch2 --> did some changes --> add, commit and push --> Now switch back to branch1 --> did git stash pop stash@{0} ===> My changes are gone :( How…
prago
  • 5,225
  • 5
  • 25
  • 27
0
votes
2 answers

git rebase: weird stash behaviour

I did a git rebase -i, selected one commit for edit and git stopped at that commit. I now try to checkout one patch from the stash with git checkout -p stash. But this gives me weird old stash contents while git stash show -p gives me the…
Oliver Kötter
  • 1,006
  • 11
  • 29
0
votes
2 answers

stash show with message description ambiguous argument

I have this on my windows-bash console and git repository: $ git stash list stash@{0}: WIP on Issue55A: cc3f7ff A3 stash@{1}: On Issue55A: A named stash Then I would like to show/apply/pop with the message (or part of it) and I am trying this…
ferpega
  • 3,182
  • 7
  • 45
  • 65
0
votes
0 answers

When does Stashing happen?

I modified a file in branch1, it was in "Modified" state and later I checkoud to branch2 without stashing it as I was expecting it to take a Automatic stash. But Stashing did not happen and the same file was in "Modified" state in the branch2 as…
0
votes
1 answer

How to automatically check if no changes were introduced since the last stash and drop them?

The use-case scenario is as follows: git checkout branch-1 [introduce some changes I don't want to commit (but want to preserve)] git stash save "my useful changes" git checkout branch-2 [do some business with branch-2] git checkout branch-1 git…
Vladislav Ivanishin
  • 2,092
  • 16
  • 22
0
votes
2 answers

Store credentials for git commands using HTTP

I would like to store Git credentials for git pulls permenantly on a linux machine, and git credential.helper doesn't work ( I think because I'm not using SSH ) - I get that error "Fatal: could not read password for 'http://....': No such device or…
Poka Yoke
  • 373
  • 3
  • 8
  • 27