我无法进行GIT藏匿,因为它说我需要先合并。有一些文件需要合并。但我的问题是我不想推动这些变化。我已经尝试过git stash,但它抱怨说有些文件尚未合并。
但是,我不想合并文件,因为我想在我做其他工作的同时将这些更改存储3周。我怎样才能存储我的更改,只需干净地结账而不进行提交?
这是我尝试过的:
git stash save "my work"
src/com/core/HomePageActivity.java: needs merge
src/com/core/PageActivity.java: needs merge
src/com/core/analytics/PageMaker.java: needs merge
git status的结果:
git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: lint.xml
modified: src/com/lib/Signal.java
modified: src/com/lib/Report.java
modified: src/com/lib/core/Menu.java
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: src/com/core/HomePageActivity.java
both modified: src/com/core/PageActivity.java
both modified: src/com/core/analytics/PageNameMaker.java
both modified: src/com/store/MapActivity.java
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: src/com/score/TiledActivity.java
modified: src/com/core/store/Action.java
答案 0 :(得分:0)
git merge --abort可能无法重建合并前状态。为了避免这种情况,您可以执行以下操作
您可以提交未提交的更改。这些变化将保持在当地。此后,您可以使用
git merge --abort
根据{{3}}的现在将尝试重建合并前状态。它现在可能会成功,因为现在你没有任何未提交的东西。
完成此操作后,您可以还原提交并存储更改。