简体   繁体   English

最新提交的Git Pull Request

[英]Git Pull Request with latest commit

I am trying to make a pull request on git hub with only my latest commit. 我正在尝试仅使用我的最新提交在git hub上发出拉取请求。 I have tried making a new branch, putting the commit on that branch and then cherry-picking the commit I want on another branch. 我尝试过创建一个新分支,将提交放在该分支上,然后在另一分支上挑选我想要的提交。 However, this does not work and any new branch I create (even if I cherry-pick commits) stays the same. 但是,这不起作用,并且我创建的任何新分支(即使我做出了选择)也保持不变。 I have tried rebase -i but then no commits show up. 我试过rebase -i,但是没有提交。 Could someone please give directions/instructions of how to do this properly? 有人可以给我指导/说明如何正确执行此操作吗?

Update I have two branches, master and develop. 更新我有两个分支,即master和develop。 I made another branch limit_screen to put in a feature. 我做了另一个分支limit_screen来添加一个功能。 I have committed the changes to the limit_screen branch. 我已将更改提交到limit_screen分支。 I then make another branch, feature, off of develop. 然后,我将不再开发另一个分支,即功能。 I then cherry-pick the commit from limit_screen. 然后,我从limit_screen中挑选提交。 Then I push limit_screen and feature. 然后,我按limit_screen和功能。 When I create a new pull request, the number of commits it lists is 8, (the number for the whole project). 当我创建一个新的拉取请求时,它列出的提交数量为8(整个项目的数量)。 I would like it just have my last commit (the one I put on limit_screen) 我希望它只有我的最后一次提交(我在limit_screen上提交的那个)

If you want only your commit to show up in the pull request, you need to create branch off of master and commit on the new branch and then create pull request. 如果只希望在提交请求中显示提交,则需要从master创建分支,然后在新分支上提交,然后创建请求。 The branches that you are currently working on have commits which have not been merged into master and that's why it shows up in the pull request. 您当前正在处理的分支具有尚未合并到master中的提交,这就是为什么它显示在pull请求中的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM