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
-1
votes
2 answers

Pull in the oldest stash

Using following stash list how you pull in the oldest stash while ensuring that you maintain it in the stash. The list is : stash@{0}: WIP on feature/feature1: 2f78364 New text stash@{1}: WIP on feature/feature1: 2f78364 New text Options are: git…
Kavita Kulkarni
  • 193
  • 2
  • 4
  • 12
-1
votes
1 answer

How do I remove the conflict warnings in code from a stash

So I made some changes to some translation files in a directory (note that those changes aren't done manually, they are made by a command that updates the translation files based on a project's source code). I then stashed those changes and switched…
aydaymay
  • 1
  • 1
-1
votes
1 answer

Merge conflict in Git. Need local env prior to Git Stash + Pull

I used the following git commands: git stash git pull After pull, the command line displayed: Auto-merging ...path/ConflictFile.xxx CONFLICT (content): Merge conflict in ...path/ConflictFile.xxx Automatic merge failed; fix conflicts and then commit…
-1
votes
1 answer

how to recover files after (git stash save --include-untrack)

How to recover files after (git stash save --include-untrack). I used angular 10 and visual studio Code. I need to recover those files after this command delete it.
-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,903
  • 5
  • 27
  • 39
-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…
Ash28
  • 85
  • 1
  • 1
  • 11
-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,680
  • 10
  • 40
  • 68
-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…
AncientSwordRage
  • 7,086
  • 19
  • 90
  • 173
-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
  • 15,263
  • 17
  • 90
  • 167
-1
votes
1 answer

developer vs release branch gitflow

I'm new to gitflow so have a few questions. Do we really need the developer branch? What purpose does it serve? We can very well have a master branch where everything gets merged to production level. Then for each release we have release branches…
Samar
  • 443
  • 1
  • 5
  • 17
-1
votes
1 answer

How to switch local branches various scenario

I need to have some strategies while using Git as my version control. Following are few scenarios while using local branches. Can someone, please, explain how can I deal with those: A and B are local branches X is remote branch A is pulled from X,…
-1
votes
2 answers

git pull replaces existing code

After I committed files in Git, I made a pull request but it stops some of my code functionality. I want to go to the previous stage, before I committed my files, the state previous to this pull request. I found git stash is an option to go to…
Sajid Ahmad
  • 1,124
  • 4
  • 18
  • 40
-2
votes
1 answer

How to stash the complete state of the worktree, including ignored, untracked, staged and/or unstaged files?

I have a client with a bunch of messy things done to it that I want to stash off so that I have a pristine state but can get back to the mess at a later date. Things I want to stash and then recover may include: things in the scope of…
BCS
  • 75,627
  • 68
  • 187
  • 294
-2
votes
1 answer

modify a previous commit before pull

I need to modify a previous commit, applying a saved stash over 2 files which were not present on that commit. I am trying to rebase with "git rebase 0c1192a^" but I get the message "Current branch artists is up to date.". How can I rebase, make the…
Jorge
  • 333
  • 1
  • 5
  • 17
1 2 3
44
45