How do you stash an untracked file?

I have changes to a file, plus a new file, and would like to use git stash to put them away while I switch to another task. But git stash by itself stashes only the changes to the existing file;...

Git pull: error: Entry foo not uptodate. Cannot merge

I'm trying to update my repo from a remote branch and keep getting this error when I do a "git pull". I haven't made any local changes, and even if I have I don't need to keep them. I've...

Move existing, uncommitted work to a new branch in Git

I started some work on a new feature and after coding for a bit, I decided this feature should be on its own branch. How do I move the existing uncommitted changes to a new branch and reset my...

Is it possible to push a git stash to a remote repository?

In git, is it possible to create a stash, push the stash to a remote repository, retrieve the stash on another computer, and apply the stash? Or are my options: Create a patch and copy the patch...

Export a stash to another computer

I need a way to export a stashed change to another computer. On computer 1 I did $ git stash save feature I'm trying to get the stash patch to a file and then import it to another computer $ git...

How do you tell git to stash the index only?

I have just used "git add -p" to add a bunch of changes to the index, and I just realised that I missed a change that should've gone into the previous commit. I can't commit --amend now because...

How can I git stash a specific file?

How can I stash a specific file leaving the others currently modified out of the stash I am about to save? For example, if git status gives me this: younker % gst # On branch master # Your...

Git: cannot checkout branch - error: pathspec '...' did not match any file(s) known to git

I'm not sure why I'm unable to checkout a branch that I had worked on earlier. See the commands below (note: co is an alias for checkout): [email protected]:~/source/unstilted$ git branch -a *...

Git: How to revert 2 files that are stubbornly stuck at "Changed but not committed"?

I have a repo that has two files that supposedly I changed locally. So I'm stuck with this: $ git status # On branch master # Changed but not updated: # (use "git add <file>..." to update what...

Aborting a stash pop in Git

I popped a stash and there was a merge conflict. Unlike the question that is listed as a duplicate, I already had some uncommitted changes in the directory which I wanted to keep. I don't just...

Git asks to commit or stash, but there's nothing to commit

While trying to pull from a remote branch I get an error: Your local changes to the following files would be overwritten by merge: app/..../_shared.scss Git is asking to commit the file or to...

git checkout throws an error on --assume-unchanged files

After I run git update-index --assume-unchanged path/to/file on a particular branch, I'm unable to switch branches using git checkout. It throws the following error: error: Your local changes to...

How to unstash only certain files?

I stashed my changes. Now I want to unstash only some files from the stash. How can I do this?

git stash save -u and -p

I'm trying to split up one commit into five commits. My plan was to use git stash save -p and stash everything except what I want in the first commit. Then commit the changes, git stash apply,...

Git command to checkout any branch and overwrite local changes

Is there a Git command (or a short sequence of commands) that will safely and surely do the following? Get rid of any local changes. Fetch the given branch from origin if necessary Checkout the...

git remove file from stash

I have a stash with a bunch of files in it. But I can't apply my stash because of a conflicting file. I've identified the problematic file in my stash and I want to remove it. How can I remove a...

Error: Cannot pull with rebase: You have unstaged changes

I have started collaborating with a few friends on a project & they use the heroku git repository. I cloned the repository a few days ago and they have since made some changes so I am trying to...

How to disable pull requests in GitHub?

I am trying to understand how will I be able to disable "pull requests" in github. Question 1: We are trying to use the rebase workflow and that means using pull requests can be harmful if that...

How can I print the log for a branch other than the current one?

I'm on a branch with some changes. Changing branch is a pain as some files are locked by processes, so to change branch I'd have to stop all the processes which have locks, then stash the changes...

Apply stash to different branch

I was accidentally working on the wrong branch. Now I want to transfer all my changes to the correct branch. If I stash the changes and apply them on the correct branch, will it only add the...

"Git stash apply" all files, except one

I made a stash of multiple files (30 +) using git stash. I now want to apply the stash to all files except one. What is the best way to achieve this?

How to checkout only one branch?

We have two Git branches, dev and master. Both are in stash. When starting, I was on the local copy of the master branch. I ran Git checkout dev to switch to the dev branch then wanted to check...

Git Bash (mintty) is extremely slow on Windows 10 OS

I installed Git on my Windows 10 a couple of months ago. It worked fine for some time. But now, it's running so slow. The git status command takes 7 seconds to execute, and git stash takes many...

How to drop file in a stash without applying it?

I am surprised not having found a response to this question but basically say I have a stash with several files in it (I can explore it through git extension for instance). Looking at its content,...

egit lock fail eclipse

So at work we all share the same stash were we push and pull our branches and all that good git stuff. So i usually do my pull and push from egit in eclipse (I am not the only one most people here...

Is it possible to use git stash command from Visual Studio

I'm using Visual Studio 2017's Team Explorer to work with a git repository. Every time I'm uses the git stash or git stash pop, I need to open the Git Bash console and navigate to my project...

BitBucket Pipelines doesn't execute whole shell script even though it works when executed directly on server

I have a small shell script for deployment which I use in my bitbucket pipeline. I successfully tested that bitbucket pipeline executes the script on my server with this step (I tried it by...

git discard specifically changes in the staging area

There are cases where I want to discard all the files currently in the staging area and only the files currently in the staging area. Essentially I want something that is just like making a commit...

Git stash from VS Code fails to stash

Git stash from the Visual Studio Code - Source Control tab popup menu fails to stash. This worked without problem for this repository about two months ago. Now it fails nearly all the time (but...

How to stash in Visual Studio 2022?

There is no way to use git stash here, except apply and pop