I run 'git branch -r' and get
origin/branch1
origin/branch2
From the man page, the -r option will "list or delete (if used with -d) the remote-tracking branches". So origin/branch1 and origin/branch2 are known as remote-tracking branches. However, you can't commit directly onto a remote-tracking branch (an anonymous branch will be created instead). A remote-tracking branch simply tracks a remote branch when running 'git fetch'.
Here's where the semantics get a little blurry for me. If I then
git checkout -b branch1 origin/branch1
I get the following output: "Branch branch1 set up to track remote branch branch1 from origin. Switched to a new branch 'branch1'"
Here's my question, put as verbosely as possible to clarify what's confusing me... By virtue of having branch1 set up to track remote branch branch1 from origin, is 'branch1' thus considered a remote-tracking branch? If so, doesn't this conflict with the fact that 'origin/branch1' was already listed as a remote tracking branch when running 'git branch -r'? From what I understand, there exist either local (topic) branches or remote-tracking branches. When running 'git checkout -b branch1 origin/branch1', am I creating a local (topic) branch (onto which I can add commits) that is tracking a remote branch by way of fetches? Running 'git branch' now gives: '* branch1', and running 'git branch -r' still gives 'origin/branch1' and 'origin/branch2'. I created branch1 to add commits to and to track origin/branch1. Which is considered the remote-tracking branch, 'branch1' from the output of 'git branch', or 'origin/branch1' from the output of 'git branch -r'?