我有一个git分支(称为v4),它是昨天才由master制作的。我想对v4进行一些母版更改。因此,在v4中,我尝试从master进行重新设置,一个文件使问题不断恶化:一个单行文本文件,其中包含版本号。该文件是app/views/common/version.txt
,在重新定标前包含以下文本:
v1.4-alpha-02
这是我在做什么:
> git rebase master
First, rewinding head to replay your work on top of it...
Applying: new version, new branch
error: patch failed: app/views/common/version.txt:1
error: app/views/common/version.txt: patch does not apply
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging app/views/common/version.txt
CONFLICT (content): Merge conflict in app/views/common/version.txt
Failed to merge in the changes.
Patch failed at 0001 new version, new branch
When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".
在version.txt
现在看起来是这样的:
<<<<<<< HEAD:app/views/common/version.txt
v1.4-alpha-02
=======
v1.4-alpha-01
>>>>>>> new version, new branch:app/views/common/version.txt
因此,我整理了一下,现在看起来像这样:
v1.4-alpha-02
然后我尝试继续:首先尝试提交:
> git commit -a -m "merged"
# Not currently on any branch.
nothing to commit (working directory clean)
那里没有运气。所以,我试图添加文件:
git add app/views/common/version.txt
没有反应。我猜没有消息是好消息。因此,我尝试继续:
> git rebase --continue
Applying: new version, new branch
No changes - did you forget to use 'git add'?
When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".
正是在这一点上,我不断地转过身,把头从桌子上摔下来。
这里发生了什么?我究竟做错了什么?谁能让我挺直?
编辑-对于unutbu
我按照您的建议更改了文件,并得到了相同的错误:
> git rebase master
First, rewinding head to replay your work on top of it...
Applying: new version, new branch
error: patch failed: app/views/common/version.txt:1
error: app/views/common/version.txt: patch does not apply
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging app/views/common/version.txt
CONFLICT (content): Merge conflict in app/views/common/version.txt
Failed to merge in the changes.
Patch failed at 0001 new version, new branch
When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".