为什么我的GitHub pull请求有两个提交? [英] Why does my GitHub pull request have two commits?

查看:104
本文介绍了为什么我的GitHub pull请求有两个提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在GIT上分了一个项目,并开始贡献。
从我所了解的情况来看,该项目在我克隆该项目时有一个挂起请求,而后来第三个人的提交被项目所有者拒绝。



我已经完成了我的更改(添加了一个新文件),并且我想将其推送到项目的主分支。所以我把它推到了我的github master分支,然后我想提出一个pull请求。



如果我不清楚,我已经完成了:


  • 克隆项目

  • 添加一个文件& commit

  • 将我的更改推送到我的github分支

  • 想要进行拉取请求。 (但尚未)



在拉取请求中,我有2次提交(但我只做了1次):


  • 我的(最近的)

  • 另一个人的拒绝拉取请求。
  • >


所以我只想为我的提交做一个拉取请求,并且删除以前的提交或做一些事情来避免我每次都遇到这个问题。

注1;
我使用SmartGit客户端,但是如果指令清晰明了,我不介意使用shell客户端。



Note2;
我还没有创建任何分支。



谢谢!

解决方案

div>

既然你没有在我的评论中回答这个问题,我只会做出一个明智的猜测。我认为第三方提交的唯一原因可能是作为向上游开发人员提交请求的一部分,如果您在第三方的提交之上而不是上游主提交的最后提交之前创建了提交。 p>

您可以通过查看 git log 或从GitHub的提交列表中查看。我的猜测是,无论是从第三方的存储库中克隆出来的,还是在创建提交前拉入了他/她的更改。


I've forked a project on GIT, and started contributing. From what I've understood, that project has a pending pull request at the time I cloned the project, and later that commit of a 3rd person was refused by the project owner.

I've done my change (adding a single new file), and I wanted to push it to the master branch of the project. So I've pushed it to my github master branch, and then I wanted to make a pull request.

In case I'm not clear, I've done this:

  • Clone the project
  • add a file & commit
  • push my changes to my github branch
  • wanted to make a pull-request. (but didn't yet)

In the pull request, I've 2 commits ( but I've only made 1 ):

  • Mine ( the most recent )
  • The refused pull request of another person.

So I only want to make a pull request for my commit, and remove the previous commit or do something to avoid me having that problem every time.

Note1; I use the SmartGit client, but if the instructions are clear and well explained, I don't mind using the shell client too.

Note2; I've not created any branch yet.

Thanks !

解决方案

Since you haven't answered the question in my comment, I'll just take an informed guess. The only reason I can think of that the third party's commit would appear as part of your pull request to the upstream developer is if you created your commit on top of the third party's commit rather than on the last commit of the upstream master.

You can check this by looking at git log or from GitHub's commit list. My guess would be that either you cloned from the third party's repository, or had pulled in his / her changes before creating your commit.

这篇关于为什么我的GitHub pull请求有两个提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆