


> Branch master set up to track remote branch master from origin. Just issue : $ git branch -set-upstream master origin/master Let's say want to set the remote branch origin/master to be the tracking branch for the local master branch you've checked out. It's the branch you fetch/pull from whenever you issue a plain git fetch/ git pull, without arguments. It is 'the branch' (if any) on 'said remote', which is tracking the 'current branch' on your 'local repository'. Url = On the other hand, meaning for GIT is unique : git/configreads : įetch = +refs/heads/*:refs/remotes/origin/*įetch = +refs/heads/*:refs/remotes/upstream/* Those are just interchangeable names, only the url identifies them.

repos pulling from the upstream one, with the rebased branch), all of them having potentially to deal with the duplicate commits.Īgain, with the "flow of data" analogy, in a DVCS, one bad command "upstream" can have a " ripple effect" downstream. That is bad because for one "upstream" repo, there can be many downstream repos (i.e. It means you are pulling from an "upstream" repo where a rebase took place, and you (the "downstream" repo) is stuck with the consequence (lots of duplicate commits, because the branch rebased upstream recreated the commits of the same branch you have locally). You can see an illustration in the git-rebase man page with the paragraph "RECOVERING FROM UPSTREAM REBASE": In term of " flow of data", your repo is at the bottom ("downstream") of a flow coming from upstream repos ("pull from") and going back to (the same or other) upstream repos ("push to"). you don't know what downstream is made of (the other repos pulling from or pushing to your repo).you know what upstream is (the repos you are pulling from or pushing to).The DVCS (Distributed Version Control System) twist is: you have no idea what downstream actually is, beside your own repo relative to the remote repos you have declared.

Note the "from" and "for": you are not just "downstream", you are "downstream from/for", hence the relative aspect. you are pushing to upstream ("otherRepo" is still "upstream", where the information now goes back to).you are pulling from upstream "otherRepo" ("otherRepo" is "upstream from you", and you are "downstream for otherRepo").If "yourRepo" has declared "otherRepo" as a remote one, then: Those notions are always relative between two repos and depends on the way data flows: , that simply means there is no absolute upstream repo or downstream repo. One important aspect of git is it is distributed, and being distributed largely means there is no inherent "upstream" or "downstream" in the system.
