The short answer is "no, and you should not even try".
A remote-tracking branch name is not a branch, despite the name "remote-tracking branch name". Instead, it's your Git's memory of some other Git's branch name. This serves several purposes, including the ability to create your own branch names from these remote-tracking names.
In Git, a branch or tag name, like master
or v1.1
, is a device Git provides to let you assign a human-readable name to a (one, single) hash ID. These hash IDs are usually the IDs of commits. (The normal exception occurs with tags, which can name tag objects, which then name commits; this is how Git implements annotated tags.)
What makes (local) branch names special is that they have the unique property that you can "get on them", by running git checkout
with a branch name. Once you do, git status
will say things like on branch master
. And—this is the really special trick—if you now make a new commit, Git will automatically store the new commit's hash ID in the current branch name, i.e., the one you're "on".
As another special trick, if you tell Git to get on to some branch name B
, and branch name B
currently does not exist, Git will scan your set of remote-tracking names, such as origin/master
and origin/B
. If it finds exactly one such name, it will:
- create a new name
B
- pointing to the same commit as
origin/B
- and set to track
origin/B
(these term are especially unfortunate: a local branch name "tracks" a "remote-tracking" branch name, which is named according to the remote, and yet every single one of these things is local!).
Every time you run git fetch origin
, your Git calls up another Git, at the URL associated with the remote named origin
. The other Git tells your Git what branch names it has right now, and what commit IDs go with those names. Your Git downloads any new commits and, at this time, updates your remote-tracking names to match their names, updating your Git's memory of what is in their Git over there. So even if you do manage to do something with the remote-tracking names, you'll wipe out all your efforts on every git fetch
.
Note that once you have a branch named B
, it's totally independent of what happens to your origin/B
, until and unless you instruct your Git to do something to re-synchronize with your origin/B
. You might do this after you git fetch
, to first synchronize origin/B
with the Git at origin
, then to synchronize your B
with your origin/B
.
(Git provides the two-step "synchronize, then synchronize again" as a convenience command, git pull
, but for anyone starting with Git, I recommend avoiding this command—it does too much, sometimes poorly; and when something fails, it leaves you in a mess you can't recover from because you don't know which step failed and cannot read the correct documentation, which is specific to that step!)