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
691
questions
0
votes
2
answers
54
views
How to detect when git stash push reports "No local changes to save"?
I'm using git stash push -a in a script to save uncommitted changes and then sometime later run git stash pop in the same script to restore the stashed changes. I've run into a problem in which git ...
1
vote
1
answer
47
views
Quick way to organize and delete local stashes
I want to stash my changes, but I often have temporary stashes that accumulate, which I want to delete. I also have important stashes, so "drop all" isn't an option.
Deleting stashes one by ...
0
votes
1
answer
83
views
Check whether a commit is a stash entry
I need to know in my script whether a given commit is a standard commit or a stash entry.
The method should work also for dropped stashes that are not garbage collected yet, so it cannot rely on ...
0
votes
2
answers
99
views
git lost a commit after stash and merge
I had a weird problem yesterday.
committed change on branch add-trans with log message add transaction final
checked out to branch react, but one file was modified, I had to stash it
stashed the file
...
2
votes
1
answer
59
views
Git stash: How to stash tracked files into a single stash via script?
I often do something like git add/checkout/stash -- (find -name "*.extension").
For example, to revert all text files or all images.
It works fine with add and checkout.
When using add, ...
0
votes
4
answers
76
views
`git stash pop` confusion after `git stash -k` and changing the branch
I had a situation I don't really understand with git 2.26.2:
Implementing a new feature in a feature branch (say n-feature), I discovered two minor issues that should be fixed in the main branch (say ...
0
votes
0
answers
17
views
How do I perform new work on a file already in an unmerged GitHub PR?
To start, I'm still a git noob... I know my way around with basic commands to get and manage content, open PR's, etc. We have a single .yaml file that we maintain for all of our API operations in our &...
0
votes
0
answers
47
views
Bogus Git error message... can't fix or work around it [duplicate]
Something has happened to my local copy of a Git repo. When I try to synch it to the server (git pull) I get the following message.
Updating 060b8f7..af17d97
error: Your local changes to the following ...
0
votes
0
answers
27
views
Git stash pop - lost untracked files
after "git pull" I got the message that my local changes would be overwritten for some files so that I have to commit my changes or stash them before merge.
Unfortunately I did "git ...
0
votes
1
answer
212
views
How can I copy the Sourcetree stashes from old PC to a new one?
I built a new PC and I'd like to know if there's a way to copy all the stashes from Sourcetree on my old PC to the Sourcetree on the new PC.
I copied the whole Atlassian folder from C:\Users<...
0
votes
1
answer
47
views
Git move latest commit on a branch to stash
When working on a git branch I got some changes in the latest commit. I suspect those changes to be wrong, but not sure. It is easy to remove the commit, and start over.
I want to move that commit to ...
0
votes
1
answer
31
views
git: recover untracked files after git stash - git stash apply
After
sudo git stash
sudo git stash apply stash@{1}
untracked files which were not stashed were deleted.
Is there a way to restore them? I'm using Centos 7.
Tried to list these files in git somewhere
...
0
votes
1
answer
65
views
Is there a way I can intentionally cause a merge conflict with a file inside my stash?
I have a single SCSS file inside my stash, a few stashes back. Let's call it target.scss. It is the only file therein and contains a small handful of modified selectors.
I have since modified target....
1
vote
1
answer
327
views
`git stash apply --index` fails with `error: No valid patches in input` on one machine
When I try to pop/apply a simple stash with --index that includes files from the index/staging area, I get the following output:
$ git stash apply --index
error: No valid patches in input (allow ...
0
votes
1
answer
41
views
A one liner for stashing and simultaneously naming untracked changes and files using git stash
Here is the situation:
I have an untracked file in my repository. I'd like to stash this file using git stash and I'd like to name the stash myself. So I found out about git stash save "message&...