如何从git中的特定远程请求拉取请求? [英] how to request pull request from a particular remote in git?

查看:157
本文介绍了如何从git中的特定远程请求拉取请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的git配置文件的样子:

This is how my config file of git looks:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = false
[remote "origin"]
        url = git@github.com:XXXXXXX/training.test.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master
[remote "upstream"]
        url = https://github.com/YYYYYYY/training.test.git
        fetch = +refs/heads/*:refs/remotes/upstream/*

remote来源"指向我的github帐户 remote上游"指向与我分叉到我的地方不同的github帐户.

The remote "origin" points to my github account The remote "upstream" points to a different github account from where I forked into mine.

Q1:所以每次我执行git pull时,它都会从我的remote(即原点")中返回pull. 我将如何做remote upstreamgit pull.

Q1: so everytime I do a git pull, it will pull from my remote (which is "origin"). how will I do a git pull of the remote upstream .

Q2:我commit and push对我的存储库进行的任何更改,都必须通知其他用户"YYYYY"以进行拉取请求.我将如何实现呢?

Q2: any changes I commit and push to my repository, the other user "YYYYY" must be notified for a pull request. how would I achieve this?

推荐答案

  1. git pull remoterepo remotebranch[:localbranch](例如git pull upstream foo:bargit pull pustream foo)

git checkout --track upstream/remotebranch(如果您的本地存储库中没有这样的名为remotebranch

or git checkout --track upstream/remotebranch if your local repo has no such a branch named remotebranch

您可以使用git branch -r显示远程分支.

you can use git branch -r to show the remote branchs.

这篇关于如何从git中的特定远程请求拉取请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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