Note: if we are actually talking about forking (which is the act of cloning a repo on the server side) and not simple cloning, then the schema is:
BitBucket
------------[P]-----------
| ^ |
| | |
(forked) (pull request) (forked)
| |
v v
[M] [C]
| |
----|------------------------|-----
| Local workstations |
| |
(git clone) (git clone)
| |
v v
[MLocal] [CLocal]
In other words, M
and C
are on the BitBucket servers, not on Muser
and Cuser
local workstations.
'origin
' would be their respective upstream repo of MLocal
and CLocal
, that is M or C, not P
.
(See "What is the difference between origin and upstream", for GitHub, but applies also for BitBucket)
This is useful for Muser because:
Muser
might not want to push directly to P
(he could though, he is the owner of P
on BitBucket), so here, repo M
acts as his "buffer"
Cuser
has no right to push on P
, so he must to fork as well
In that case, for Cuser
to see any updates on P
, he needs to add P
as a remote to CLocal
repo (ie his cloned local repo of his fork)
git remote add P https://bitbucket.org/Puser/P
git pull P master
Once those new changes are integrated and tested locally (on CLocal
), they can be pushed back to C
, along with new evolutions introduced by Cuser
. Only those new modifications will be part of a pull request, for Muser
(and P
owner) to examine and add to P.
Similarly, Muser
would need to add P
as a remote to MLocal
, in order to get back any modifications from C
that were accepted into P
.