文件已在提交 n 时添加到 git。我如何添加它来提交 nm?
我有一个分支机构。中途我注意到 git 没有跟踪它应该跟踪的文件,所以我将其添加为提交的一部分并继续我的工作。现在,我正在执行 git bisect,并且添加文件之前的所有提交都不会构建。所以我在想,我需要将添加文件的提交分成两部分:文件添加和提交的其余部分。然后,我需要重新排序提交,以便文件添加提交将位于我的分支的开头。这是正确的解决方案还是有更好的方法?
I have a branch. Half way through I noticed git was not tracking a file that it should have been and so I added it as part of a commit and continued with my work. Now, I'm doing a git bisect and all commits before the file was added do not build. So I'm thinking, I need to split the commit that added the file into two parts: the file add and the rest of the commit. I then need to re-order the commits so that the file add commit will be at the beginning of my branch. Is this the correct solution or is there a better way of doing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来拆分和重新排序是完成您想要的操作的最简单方法。
它与以下内容相同:
It looks like the split and reorder is the easiest way to do what you want.
It would the same than: