699 questions
-1
votes
0
answers
37
views
How can I undo a stash apply in Visual Studio 2022?
I applied a stash in Visual Studio 2022 to the wrong branch. How do I undo that? Sadly, there is no 'Undo Changes' option when I right click.
3
votes
1
answer
45
views
How to view the changes to a particular file in stash in git?
I am trying to find what the modification a particular stash, say stash@{1}, made to a file.
I tried using the command:
git stash show -p "stash@{1]" -- {filename}
but got the error too ...
-1
votes
4
answers
114
views
Can I easily cherry pick some commit to stash?
I'd like to pick some commit from the history and load its changes to my stash, just to use it freely anywhere. Is it possible?
Edit: thanks for your answers, maybe I'd add that I hoped for some way ...
1
vote
2
answers
59
views
intended flow when git stash pop gets conflicts
I ran git stash pop and got some conflicts. It's a similar experience to conflicts from a rebase or merge, and I've been resolving them.
I don't really understand what flow I'm supposed to be ...
3
votes
2
answers
77
views
Git-hook to show if I've got a stash on the checked out branch
The following has happened a couple of time and I'm looking for an automated way to catch myself before I repeat the mistake. Solutions saying "just remember" or "just don't do that&...
0
votes
0
answers
79
views
Jupyter Notebook (.ipynb) Not Opening as Notebook in VSCode After Merge Conflict
I'm using VSCode for my Jupyter notebook development, and I encountered an issue after attempting to git stash apply that resulted in merge conflicts. The conflicted .ipynb files now open as JSON ...
0
votes
2
answers
117
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
57
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
95
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
109
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
67
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
209
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
19
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
48
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
30
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
593
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
60
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
34
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
68
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
547
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
45
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&...
1
vote
2
answers
110
views
Pop conflicting Git stash while keeping stash index
Explanation:
I make a heavy use of Git staging area to keep track of the changes that I'm already sure of while the working directory is often a mess of untested solutions, TODOs and a code that is ...
0
votes
1
answer
35
views
git stash show -p: hide gitignored files
When I use stash, I run git stash -u so that all files are stashed.
When I want to look at the stash contents using git stash show -p, it will also include in the diff files which are in my .gitignore ...
4
votes
1
answer
537
views
"git stash apply" not applying untracked files
I earlier ran git stash push -u ... to include an untracked file in the stash. Now, I've confirmed that this stash, stash@{2}, includes this untracked file (and tracked file changes). But, when I run ...
0
votes
1
answer
34
views
How to recover deleted files from git after switching branch without stash
I've made some local changes and didn't pushed to repository, accident tally switched to another branch without stashing my changes, i did
git checkout .
Now i realized that after switching to my ...
4
votes
2
answers
842
views
Git stash clear and drop are not really clearing the changes
Have you ever tried these steps with git stash?
touch file1
git add file1
git stash
cat .git/refs/stash # ==> copy the content, which is the latest stashed <sha_1>
git stash clear # ==> we ...
-1
votes
2
answers
127
views
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 ...
0
votes
0
answers
52
views
Stash or commit changes so local repo is up to date with remote repo?
I have a local repo with 50 submodules. My teammates recently made some deletions on the remote repo of 5 submodules. So I'm behind one commit and have extra submodules.
I want to update my local I ...
1
vote
2
answers
1k
views
Git: How to checkout previous commit without committing changes?
I want to checkout a previous commit, but I've made changes, so it's prompting me to commit or stash the changes first. I don't have the changes at the point where I want to commit them yet. Is this ...
0
votes
1
answer
248
views
How to git stash only the conflicting files in a git pull?
I'm looking for a command(s) to git stash only the list of files that would be overwritten/conflicting when doing a git pull, all at once. I just want to accept all the remote changes and deal with ...
1
vote
0
answers
117
views
Stashed files reappearing in "unstaged" section of sourcetree (and in git status output)
In Sourcetree (3.4.10) if I stash my current folder, the files that were modified pops back again in my "unstaged" area.
this even though I havn't selected the flag "keep staged ...
0
votes
1
answer
61
views
git stash -how to switch between uncommitted versions
[git newbie here]
Say I'm working on a new file and I'm writing the following story:
Version1: A guy walks into a bar
[here I tell my story]
At this point I like what I wrote but I wish to ...
0
votes
0
answers
75
views
How to solve a git stash conflict
Hi guys I have the following issue.
I performed a git stash first
Then a git pull
then sorted out the conflicts
Now I am trying to do a git stash pop so as to bring back the changes I made and add ...
0
votes
1
answer
96
views
how to view git stashes without the need to reset?
git newbie here: I have a list of stashes:
aws-0292@procolharum MINGW64 ~/phuber/magic (master)
$ git stash list
stash@{0}: On master: 30 or 31
stash@{1}: On master: music
stash@{2}: On master: this ...
25
votes
6
answers
30k
views
How do I restore the stashes menu in Visual Studio Codes Source Control panel?
I can't find the Stashes (nor REMOTES, BRANCHES, FILE HISTORY) menu in the Source Control (the one you open up with Ctrl-Shift-U) tool bar.
This is how my Visual Studio Code looks like:
And this is a ...
2
votes
4
answers
1k
views
git pop failed with "error: could not restore untracked files from stash"
I have done about 2 months work locally against main branch (without committing or staging anything). This included adding new (untracked) files and modifying existing tracked files.
Then I wanted to ...
0
votes
0
answers
23
views
Why git stash apply command does not work? [duplicate]
I have run git stash, when I am upgrading flutter. Now I am trying to run "git stash apply" command, but I get this error.
This is really important to me because it has been a lot of ...
0
votes
1
answer
329
views
Git repository corrupted and changed files are empty after PC crash
I was working with git bash, rebasing and stashing my changes when suddenly my PC crashed. After the restart, the disk was repairing, but when it loaded the repository no longer worked, git commands ...
0
votes
1
answer
73
views
Can Git stashes have a GPG signature?
My GitLab project is configured to require GPG signatures for all pushed commits. However, when I try to push a stash up to GitLab, it's rejected with the message "Commit must be signed with a ...
2
votes
1
answer
2k
views
"git stash show" after stashing only one file
Ran git stash to stash just one file out of 4 tracked files.
Using git stash show displays not only that file but the other staged files as well. Why? For example: why does it show anything other than ...
1
vote
1
answer
1k
views
How to export full stash list from one laptop to other
I am using git version 2.32.0
I just want to export the full stash list saved in my old laptop to new laptop.
How can I do so?
2
votes
1
answer
133
views
How can I create a (temporary) clean working tree for running unit tests in a git pre-commit hook?
If I forget to stage a modification/a file that is neccesary for a unit test, I want that that unit test to fail (when running inside of a pre-commit hook). The exception to this is gitignored files/...
1
vote
2
answers
649
views
All my modifications gone after git stash
I was working on the main branch, then I decided to create a new branch called test-branch. I tried git checkout feature first which warned me to stash or commit my changes. I stashed them using git ...
0
votes
2
answers
4k
views
git stash seems not to work when new files have been added?
I don't have the exact setup on me right now, but I remember adding a couple of new files to my tree and then wanting to stash them. Instead of stashing correctly, git stash returned an error:
error: ...
-1
votes
1
answer
90
views
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 ...
4
votes
2
answers
3k
views
Git Stash - Local Changes - Git Stash - Git Stash Apply - Undo
Need some help, I screwed up. Please reserve judgement.
Alright, this is what I did.
git stash
made some changes to the code.
git stash (again)
git stash apply
Is there any way I can get back to ...
1
vote
2
answers
225
views
How to make `git stash` refuse to smudge unstaged and staged changes?
Question
How do I either
make git stash error out if there are both unstaged and staged changes and I haven't specified either --staged (-S) or --keep-index (-k), or
make git stash default to --keep-...
0
votes
0
answers
33
views
Git stash untracked files doesn't work in Visual Studio Developer Powershell?
I tried several times to git stash my untracked filed in Developer Powershell without success.
C:\dir\dir2\Myrepo [develop ≡ +1 ~0 -0 !]> git stash -u
fatal: unknown subcommand: –u
usage: git ...
0
votes
1
answer
3k
views
Git Stash Pop Merge Conflict Resolution and Reason
I've recently been using git stash, git pull, and git stash pop as my work flow when I need to sync up to what other devs are doing, but save what I'm working on first, and then continue working. I ...
1
vote
0
answers
3k
views
How to share a "Git Stash" in Visual Studio / AzureDevOps?
How can you share Stashes in VS2022?
I know this can be done with Git: Export a stash to another computer.
I've done research and can't find anyway with VS2022 or AzureDevOps and am hoping for CLI ...