This is an infinite loop. I want to resolve conflicts and merge what they should do without committing. Who can tell me how to do it? Thank you
Administrator@PC201710191858 MINGW64 ~/Desktop/1/giteeTest/test2/test (master)
$ git fetch
Administrator@PC201710191858 MINGW64 ~/Desktop/1/giteeTest/test2/test (master)
$ git rebase
error: cannot rebase: You have unstaged changes.
error: Please commit or stash them.
Administrator@PC201710191858 MINGW64 ~/Desktop/1/giteeTest/test2/test (master)
$ git stash save 124
Saved working directory and index state On master: 124
Administrator@PC201710191858 MINGW64 ~/Desktop/1/giteeTest/test2/test (master)
$ git rebase
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/origin/master.
Administrator@PC201710191858 MINGW64 ~/Desktop/1/giteeTest/test2/test (master)
$ git stash pop
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: t2.txt
no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (7360745b1a57d463ad704e08be582d1841de27cb)
Administrator@PC201710191858 MINGW64 ~/Desktop/1/giteeTest/test2/test (master)
$ git rebase
error: cannot rebase: You have unstaged changes.
error: Please commit or stash them.
CodePudding user response:
You've done it. You did:
git rebase # rejected because you have unstaged changes
git stash # tucked the unstaged changes away
git rebase # ← this worked
git stash pop # ← this is the one that did what you wanted
git rebase # rejected because your unstaged changes are back, on the new base
Simple fact is, git stash pop
is the merge you're asking for. Stash save makes two commits, of your index and work tree, based on your current checkout. Stash pop merges those changes to your new checkout.
CodePudding user response:
You don't have any conflicts it seems. What you have are uncommitteted local changes.