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

How to discard a specific file changes from git stash

I want to be able to apply a stash that looks like this: git stash show --stat stash@\{1\} extensions/99/fill-thresholds.json | 2 +- html/js/1.js | 10 ++++++++++ html/pages/su/2.html | 4 ++-- …
0
votes
1 answer

Reversing a git stash resulting in patch failed

I had done a git stash and then git rebase origin/master which were both successful. However git stash apply was not so happy: $git stash apply Auto-merging yarn/pom.xml CONFLICT (content): Merge conflict in yarn/pom.xml Auto-merging…
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
0
votes
1 answer

Merge-conflict-free way to git stash changes

If I git stash -k (stash all unstaged changes) and git pop, I get merge conflicts if one of the files was modified in the staging area and also had an unstaged change. I'm writing a script that calls git stash -k, lints the files, and commits them…
Robert Balicki
  • 1,583
  • 2
  • 16
  • 24
0
votes
1 answer

How to define stash issue regex to match only from begining?

The default regex in Stash to match JIRA ID is JVM_SUPPORT_RECOMMENDED_ARGS="-Dintegration.jira.key.pattern=\"((?
valpa
  • 367
  • 1
  • 3
  • 14
0
votes
2 answers

git stash but keep whats being stash instead of reverting to last commited change

So when I git stash it will pack my changes since the last commit to a list, however is their any way that I do not have to commit, but still stash and keep the uncommitted changes or of their is any other git command for that ?
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
0
votes
2 answers

Git stash reset version to previous. How do I get my work back?

I am working with git for a college project and it has been a tricky learning curve. Last night I was trying to upload my work into the main tree and I did first a 'git stash' in terminal and it seems to have reset my code to the previous version.…
0
votes
1 answer

Git or Stash - Any way to exclude code reformatting from appearing in diffs?

For example, performing a "Reformat Code" operation in an IDE such as IntelliJ may produce a lot of formatting changes to code. Subsequently when files are committed and diffs are viewed in Git and Stash the formatting changes in the diffs make the…
MartinPicker
  • 189
  • 3
  • 12
0
votes
1 answer

How to find the physical location of a git repo on Stash server?

Given Stash URL, http://stash.abc.net/scm/gui/something.git How do I know the physical location of this repo? I am looking to find a directory to which I can cd to EDIT: What is not clear please?
James Raitsev
  • 92,517
  • 154
  • 335
  • 470
0
votes
1 answer

How to delete files from master of stash

Hi anybody could help me in deleting files from the master of stash? I am new to stash and git commands and while commiting the initial version to stash all the files from the project folder got committed to the repository but i want that files to…
Raji
  • 269
  • 2
  • 5
  • 12
0
votes
0 answers

Did a git stash - had unstaged changes, is there a way to reverse that?

i did a git stash and had some changes that were not added to the index, when i did a git stash apply, they were not reapplied. Is there a way to get back from this? Thanks and kind regards
user871784
  • 1,247
  • 4
  • 13
  • 32
0
votes
2 answers

Unable to access local Git repo after quitting during a rebase

My virtual machine shutdown during a git rebase and now the project directory has no sight of the Git repository at all. When I do a git status I get the following: vagrant@localhost /var/www/crmpicco $ git status fatal: Not a git repository (or any…
crmpicco
  • 16,605
  • 26
  • 134
  • 210
0
votes
1 answer

Jenkins stash integration with ssh

I will appreciate if anyone can point me to how to setup Jenkins for Stash repo, no need for webhooks or plugins(I think), its for testing and I'll just like to manually trigger a build. I used stash repo URL ssh://git@stash.xxxxxx:xx/xx/xx.git with…
Edpy
  • 13
  • 3
0
votes
1 answer

Backup local Git repository (notes, stashes, reflog included) and restore it on another machine

As in the title, how can I backup completely a local Git repository and its state, restore it on another machine, and have the new repository to be in the exact state as the one on the previous machine? I mainly care to not loose local stuff,…
Kamafeather
  • 8,663
  • 14
  • 69
  • 99
0
votes
1 answer

How best to stash your work, do a fresh checkout/commit/push, then go back to where you were?

In our organization we have a 'develop' branch we start new work from and eventually merge into. As is often the case in all organizations, we'll be working on a feature when a bug report comes in and we have to stop what we're doing and fix…
jkj2000
  • 1,563
  • 4
  • 19
  • 26
0
votes
1 answer

Git: After merge 2 branges the stashed changes applied to both

Is that normal? Let me explain a bit more.. I have 2 branches, say BranchA and BranchB. I want to merge these 2 branches but i have some changes in BranchA that I want to keep away and revisit, so I stash these files. Then I merge A with B (fix…
cnom
  • 3,071
  • 4
  • 30
  • 60