git-stash

Pull is not possible because you have unmerged files, git stash doesn't work. Don't want to commit

余生颓废 提交于 2019-11-28 15:47:16
问题 I just want to pull. I have changes to disregard, my Gemfile and Gemlock files and I'd be happy to just overwrite them and just pull. I tried stashing my changes away, this didn't work out for me. What do I do? git pull M Gemfile U Gemfile.lock Pull is not possible because you have unmerged files. Please, fix them up in the work tree, and then use 'git add/rm <file>' as appropriate to mark resolution, or use 'git commit -a'. ~/projects/sms/apps2/apps2_admin(apps2)$ git stash save "saved"

git stash blunder: git stash pop and ended up with merge conflicts

时光怂恿深爱的人放手 提交于 2019-11-28 15:13:58
I did a git stash pop and ended up with merge conflicts. I removed the files from the file system and did a git checkout as shown below, but it thinks the files are still unmerged. I then tried replacing the files and doing a git checkout again and same result. I event tried forcing it with -f flag. Any help would be appreciated! chirag-patels-macbook-pro:haloror patelc75$ git status app/views/layouts/_choose_patient.html.erb: needs merge app/views/layouts/_links.html.erb: needs merge # On branch prod-temp # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified:

Git stash: “Cannot apply to a dirty working tree, please stage your changes”

依然范特西╮ 提交于 2019-11-28 14:59:05
I am trying to apply changes I stashed earlier with git stash pop and get the message: Cannot apply to a dirty working tree, please stage your changes Any suggestion on how to deal with that? muhqu When I have to apply stashed changes to a dirty working copy, e.g. pop more than one changeset from the stash, I use the following: $ git stash show -p | git apply -3 && git stash drop Basically it creates a patch pipes that to the apply command if there are any conflicts they will need to be resolved via 3-way merge if apply (or merge) succeeded it drops the just applied stash item... I wonder why

git stash apply version

大城市里の小女人 提交于 2019-11-28 14:55:59
I have 2 branches: master | design Working in design I did a stash and switched to master, made some adjustments. Switched back to design and did a stash apply only to lose all my changes in the design branch. I am hoping all my work is within a stash as I have not cleared or removed these. If I do a stash list I get 4 results: stash@{0}: WIP on design: f2c0c72... Adjust Password Recover Email stash@{1}: WIP on design: f2c0c72... Adjust Password Recover Email stash@{2}: WIP on design: eb65635... Email Adjust stash@{3}: WIP on design: eb65635... Email Adjust If I try git stash apply f2c0c72 I

How to resolve git stash conflict without commit?

一个人想着一个人 提交于 2019-11-28 14:54:49
As asked in this question , I also want to know how to resolve a conflicting git stash pop without adding all modifications to a commit (just like "git stash pop" without a conflict does). My current approach is very uncool because I do it this way: git stash pop -> CONFLICT git stash drop [resolve conflict] [add conflict files] git reset HEAD <all files that are in commit-mode> [Update] A way to reproduce it: mkdir foo; cd foo; git init echo "1" > one echo "2" > two git add -A; git commit -m "first" echo "1.1" > one echo "2.1" > two git stash echo "2.2" > two git commit -a -m "second" echo

How can I format patch with what I stash away

岁酱吖の 提交于 2019-11-28 13:41:34
问题 In git, I stash away my changes. Is it possible that I can create a patch with what I stash away? And the apply that patch in some other repository (my co-worker's)? I know 'git format-patch -1' but I think that is for what I have committed. But I am looking for the same thing for changes I stashed away? And how can I apply a patch in other repository? 回答1: Sure, git stash show supports this: git stash show -p 回答2: This answer provides info about both saving the patch and applying it where

What are those 'WIP' and 'index' commits that appear after stashing?

一个人想着一个人 提交于 2019-11-28 12:02:23
When I run git lg on my local development branch, the latest commit is shown as below: * 7d21213 - (1 hours ago) update business rules - developer1 (HEAD, origin/develop, origin/HEAD, develop) However, if I stash local changes by running git stash and then run git lg , I get the following: * at12334 - (13 seconds ago) WIP on develop: 7d21213 update business rules - developer1 (refs/stash) |\ | * ef9a11b - (14 seconds ago) index on develop: 7d21213 update business rules - developer1 |/ * 7d21213 - (1 hours ago) update business rules - developer1 (HEAD, origin/develop, origin/HEAD, develop) What

git stash is slow on windows

安稳与你 提交于 2019-11-28 04:28:27
On my windows machine git stash has about 3.5 seconds overhead on each invocation, which adds about 7 seconds to my git commit hook. The same command under linux (same machine) takes about 0.01 seconds. The performance issue applies to empty repositories as well. I have tried the following from this thread and this thread : core.fscache is set to true core.preloadindex is set to true gc.auto is set to 256 Setting PS1='$ ' Running cmd in administration mode Running inside cmd.exe instead of git-bash Running GIT_TRACE=true git stash list 16:58:16.844591 git.c:563 trace: exec: 'git-stash' 'list'

Why can't stash be applied to the working directory?

送分小仙女□ 提交于 2019-11-28 04:15:25
I cannot apply stash back to the working directory. Little story: First I tried to push some committed changes, but it said: "no you can't, pull first"... OK then, I'll pull things from GitHub and then push my changes. When I tried to pull, it said that I had changes that would be overwritten, and that I should stash my changes. OK, I stashed the changes... did the pull, and push the committed changes. But now, I cannot restore the uncommitted changes I was working on. This is the error: MyPath/File.cs already exists, no checkout Could not restore untracked files from stash For sure I don't

Why does git stash pop say that it could not restore untracked files from stash entry?

送分小仙女□ 提交于 2019-11-27 20:29:18
I had a bunch of staged and unstaged changes and I wanted to quickly switch to another branch and then switch back. So I staged my changes using: $ git stash push -a (In hindsight I probably could have used --include-untracked instead of --all ) Then when I went to pop the stash I get a whole lot of errors along the lines of: $ git stash pop foo.txt already exists, no checkout bar.txt already exists, no checkout ... Could not restore untracked files from stash entry There doesn't seem to be any changes restored from the stash. I also tried $ git stash branch temp but that shows the same errors