我正在使用Laravel项目并使用git-flow来管理我的更改。我的develop分支是两个提交前的功能分支我最近完成了名为功能/注册验证码。我想将这个特性分支合并到develop分支中。如何解决与composer.lock使用git流的合并冲突?
最近提交我做这已经被合并到开发分公司只需运行composer update
更新包,其中有一个bug在里面。所以,composer.lock
文件当然已被修改。
功能/注册验证码功能分支包括添加验证码包和验证码UI到注册页面。所以,这也修改了composer.lock
文件。
当坐在特性分支我曾尝试合并提交,从源代码树,通过选择库> Git的流量>完成功能,然后在完成功能选择下列选项弹出:
我则以下消息介绍:
这会导致composer.lock
文件中存在需要解析的合并冲突。我认为最好的方法是删除composer.lock
并通过运行composer update
或composer update --lock
创建一个新的更新副本,添加unstaged composer.lock
文件并提交更改。这样做了以后我提交这个样子:
当在命令行中运行git status
我出以下几点:
c:\my-project (HEAD detached at 2a9ff12)
λ git status
rebase in progress; onto 3070450
You are currently rebasing branch 'feature/registration-captcha' on '3070450'.
(all conflicts fixed: run "git rebase --continue")
nothing to commit, working directory clean
因此,我认为做正确的事情是运行git rebase --continue
,之后我收到以下消息:
c:\my-project (HEAD detached at 2a9ff12)
λ git rebase --continue
Applying: add non captcha to registration page
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
如果我运行git status
再次显示与上次运行git status
相同的消息。
所以我现在想知道:
- 那我在这里做,完成变基/合并吗?
- 我是不是全都做错了?
- 我应该如何处理更新软件包时可能产生的冲突?
任何帮助将不胜感激,谢谢!
你不应该删除composer.lock,并在这种情况下做一个作曲家更新 - 从来没有!合并冲突是有原因的。在你的方法中,你现在更新了比你想要的更多的包。在这些情况下最简单的方法就是接受外国的composer.lock,扔掉你的版本。那么你需要记住你在分支中更新了哪些软件包(pro-tip:为你的更新语句创建一个git commit并在注释中写入语句)并明确运行作曲者更新。与亲技巧这一步可以自动化 –