如何从git中的特定远程请求拉取请求? [英] how to request pull request from a particular remote in 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 upstream
的git 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?
推荐答案
-
git pull remoterepo remotebranch[:localbranch]
(例如git pull upstream foo:bar
,git 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屋!