问题
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/*
The remote "origin" points to my github account
The remote "upstream" points to a different github account from where I forked into mine.
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: 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](e.g.git pull upstream foo:bar,git pull pustream foo)or
git checkout --track upstream/remotebranchif your local repo has no such a branch namedremotebranchyou can use
git branch -rto show the remote branchs.- you can use github webhook
回答2:
git pull upstream branchname, you can get a complete list of remote branchs bygit branch -a- you could config hook in git repository to notify all the members in a project after a push, see here and here
ps. about Q2, you can find a similar question, which provides other solutions
来源:https://stackoverflow.com/questions/20985827/how-to-request-pull-request-from-a-particular-remote-in-git