如何从我目前的状态进行拉取请求 [英] How to do a pull request from my current state

查看:160
本文介绍了如何从我目前的状态进行拉取请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经采取的措施


  1. 我从用户X发现了一个github仓库

  2. 我点击了在Visual Studio中打开

  3. 我做了一些更改并做了一次提交。它在我的本地仓库中提交。

  4. 我为Visual Studio 2017安装了github扩展

  5. 我直接从用户X创建了一个fork在我自己的github仓库中

问题我的更改在用户X的存储库中显示为拉取请求。



Visual Studio中的确切步骤(不是命令行)需要我执行哪些操作那么,鉴于我现在在哪里?



更多信息

t在用户X的这个github仓库中拥有或想要任何权限。它可能涉及从fork中执行一个pull请求。我想我似乎无法弄清楚的是如何让我的变化进入我制作的分支。一旦它在那里,我想我知道如何在我的fork中在用户X的仓库中创建一个pull请求。我的github扩展只会提到他的仓库,因此我无法将我的更改推送到我的分支中。

更新:推送到我的分叉失败



我的遥控器:



当我试图在Github上推送到我的分支时:



我得到了这个:



我在Github上的分支没有任何分支(我拥有(在Yours标签下))。所以推送失败。但我需要成功地推动获得分支,对吧?看起来像一个catch 22。

解决方案

我认为你做错了方式。



GitHub回购的贡献:
$ b


  1. Fork GutHub回购,你可以在你的GitHub账户中获得这个pero的分支。


  2. 克隆你的分支(只需点击VS打开)





  3. 从您的分叉中创建拉取请求

  4. ol>

    请参阅


    1. 前往设置:


    1. 存储库设置=>远程:



    当您进行推送时,您可以选择使用哪种远程推送方式:





    评论:改为为您本地回购添加远程,您可以将原点更改为需要推送的叉子。


    Steps already taken

    1. I found a github repository from user X
    2. I clicked "open in visual studio"
    3. I made some changes and did a commit. It committed to my local repository.
    4. I installed github extension for Visual Studio 2017
    5. I created a fork in my own github repository directly from user X's repository.

    Question

    I want my changes to appear as a pull request in the repository of user X.

    What are the exact steps in Visual Studio (not command line) that I need to take to do that, given where I am now?

    More info

    I don't have or want any permissions in this github repository of user X. It probably involves doing a pull request from a fork. I guess what I can't seem to figure out is how to get my changes into my fork that I made. Once it's there, I think I know how to create a pull request in user X's repository from my fork. My github extension only mentions his repository and therefore I can't push my changes into my fork.

    Update: Pushing to my fork fails

    My remotes:

    When I tried to push to my fork on Github:

    I got this:

    My fork on Github doesn't have any branches (that I own (under the "Yours" tab)). So the push fails. But I need to successfully do a push to get a branch, right? Seems like a catch 22.

    解决方案

    I think you did it wrong way.

    How contribute to GitHub repo:

    1. Fork GutHub repo, you get fork of this pero in your GitHub account

    2. Clone your fork (just clicking open in VS)

    3. Commit into your local repo
    4. Push to your fork
    5. Create pull request from your fork

    See guide here.

    What you can do in your current situation:

    1. Push from your local repo to your fork (you need to change remote of your local repo)
    2. create pull request from fork.

    or

    1. Clone your fork (open in VS)
    2. Merge it with you local repo, when you have commits
    3. Push to your GitHub fork
    4. Create pull request from fork.

    How to change remote of you local repo in VS:

    1. In Team Explorer tab go to Home:

    1. Go to Settings:

    1. Repository Settings => Remotes:

    When you do push, you can choose to which remote push:

    Comment: instead adding remotes for you local repo, you can just change origin to your fork, where you need to push.

    这篇关于如何从我目前的状态进行拉取请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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