本文共 623 字,大约阅读时间需要 2 分钟。
教程3 改写提交!
为了节省时间,这个教程使用现有的历史记录作为本地数据库。
下载
我们进入stepup-tutorial/tutorial4目录。本地端历史记录的状态如下图显示。仅把在其他分支执行的「添加commit的讲解」的修改导入到master分支。
把修改移动到master分支后,用cherry-pick 取出「添加commit的讲解」提交,然后将其添加到master。(文档里的提交"99daed2"和下载到数据库里的提交有可能不相同。在下载的数据库里执行git log,确认是正确的提交之后再使用。)
$ git checkout masterSwitched to branch 'master'$ git cherry-pick 99daed2error: could not apply 99daed2... commithint: after resolving the conflicts, mark the corrected pathshint: with 'git add' or 'git rm 'hint: and commit the result with 'git commit'
如果发生冲突,就打开sample.txt,修改冲突的部分之后再提交。
$ git add sample.txt$ git commit
转载地址:http://wwgef.baihongyu.com/