I think this git slash notation is probably best understood by looking inside your .git
folder.
For example, here is a somewhat abbreviated tree of my .git for the LibreOffice source base.
In linux sudo apt-get install tree
is useful to view this.
In Windows I think the tree
command might still work.
Scroll down and take a look at refs (aka 'references') near the bottom:
$ tree
.
├── branches
├── config
├── description
├── FETCH_HEAD
├── gitk.cache
├── HEAD
├── hooks
│ ├── applypatch-msg.sample
...
├── index
├── info
│ └── exclude
├── logs
│ ├── HEAD
│ └── refs
│ ├── heads
│ │ ├── master
│ │ └── remotes
│ │ └── origin
│ └── remotes
│ └── origin
│ ├── distro
│ │ ├── cib
│ │ │ └── libreoffice-6-0
│ │ ├── collabora
│ │ │ └── cp-6.0
│ │ └── lhm
│ │ └── libreoffice-5-2+backports
│ ├── HEAD
│ ├── libreoffice-6-2
│ ├── master
│ └── private
│ └── mst
│ └── sw_redlinehide_4a
├── objects
│ ├── info
│ └── pack
│ ├── pack-b80087dc57e2b3315f449ca0f1aaa91987bf0c5e.idx
│ ├── pack-b80087dc57e2b3315f449ca0f1aaa91987bf0c5e.pack
│ ├── pack-eb4e6808029e712d8d9c2671accbbd98aaeb9a04.idx
│ └── pack-eb4e6808029e712d8d9c2671accbbd98aaeb9a04.pack
├── ORIG_HEAD
├── packed-refs
└── refs
├── heads
│ ├── master
│ └── remotes
│ └── origin
├── remotes
│ └── origin
│ ├── distro
│ │ ├── cib
│ │ │ └── libreoffice-6-0
│ │ ├── collabora
│ │ │ └── cp-6.0
│ │ └── lhm
│ │ └── libreoffice-5-2+backports
│ ├── HEAD
│ ├── libreoffice-6-2
│ ├── master
│ └── private
│ └── mst
│ └── sw_redlinehide_4a
└── tags
└── libreoffice-6-2-branch-point
32 directories, 45 files
It might have been less confusing if it was laid out like this, but it wasn't:
repositories (i.e. independent trees)
├──local
│ └──master
│
└──origin1
│ └──master
└──origin2
└──master
We have three basic types of references: heads, remotes, and tags.
.git/refs/heads holds our local master.
.git/refs/remotes can hold a number of remotes, although at the moment we only have origin in it.
.git/refs/tags (is discussed elsewhere).
origin thus, is our one and only remote. It holds origin/master.
We find that we have 2 HEADS (pointers to current branches), one local, and one remote:
$ cat .git/HEAD # local: HEAD -> master
ref: refs/heads/master
$ cat .git/refs/remotes/origin/HEAD # remote origin: HEAD -> master
ref: refs/remotes/origin/master
If you list your branches:
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/aoo/aw080
remotes/origin/aoo/trunk
remotes/origin/distro/capgemini/cg-4.1
remotes/origin/distro/cib/libreoffice-5-0
remotes/origin/distro/cib/libreoffice-5-1
remotes/origin/distro/cib/libreoffice-5-2
...
- The first branch listed (master) is the only one which is not a remote. So in this case we have one local branch. This is where we'll start our own work from, for our own new branches and subsequent commits.
Next, you may have many remote tracking branches, and we do here. You know these are remote tracking branches because they are prefixed with 'remotes/'. The ones shown here are for the remote named origin.
So the second line is origin's current branch pointer. Remotes/origin: HEAD --points to--> master. This shows that in the remote repository, the current branch is their branch named master, (not to be confused with our local branch named master).
The remaining branches aren't found in your .git/refs/ tree, but rather you'll find them in .git/packed-refs
.
When we git fetch we download changes from the remote repository, into our remote tracking repository.
When we git merge we merge the changes in this local, remote tracking repository into our working local branch or branches, in this case into our master branch.
(When we git pull we do both of these two steps in one operation.)
It's also interesting to note these local and remote UUIDs for master currently point to the same node (aka 'commit'):
$ cat refs/heads/master # local master
1ca409292272632f443733450313de5a82c54a9c
$ cat refs/remotes/origin/master # remote origin master
1ca409292272632f443733450313de5a82c54a9c
So our local master points to the same place as the remote's origin master:
[local] master = [remote] origin master
Finally, I think it's also useful to take a look at .git/packed-refs
$ cat packed-refs
# pack-refs with: peeled fully-peeled
3c1d4742e649fe9c8aed8c2817fe3e1f3364f298 refs/remotes/origin/aoo/aw080
e87c8b7922e9a73e0abb7f9a7a47c9ac3374a826 refs/remotes/origin/aoo/trunk
b70fdffb041c12f124dcc0822b61bf3450e53137 refs/remotes/origin/distro/capgemini/cg-4.1
5dbc3f1754809b9489faaf380b1a4bdbcfbb6205 refs/remotes/origin/distro/cib/libreoffice-5-0
cfdbc96ca47d68d6785fd21829a8d61f49d6e591 refs/remotes/origin/distro/cib/libreoffice-5-1
5189c8c47461ef09739086e55512fc6a10245273 refs/remotes/origin/distro/cib/libreoffice-5-2
3bee5917569ca8e6ee3b086458f5b1a917b88ca1 refs/remotes/origin/distro/cib/libreoffice-5-3
92fbe703f9ca480d3a2b8610d87e991c729edf77 refs/remotes/origin/distro/cib/libreoffice-5-4
05c0a5df66cc69d75280f05b804cf82f3387d42b refs/remotes/origin/distro/cib/libreoffice-6-0
7fe193e759b24b90852e6e327115b77114d7b119 refs/remotes/origin/distro/cib/libreoffice-6-1
8187f7aa413e7ef7b377eea2b057d336bf256867 refs/remotes/origin/distro/collabora/cd-5.3
7a6b608591e21ef61dc05cff9fc58da531035755 refs/remotes/origin/distro/collabora/cd-5.3-3.1
....
No doubt this leaves more questions than answers, but I think it can start to help you answer your own questions about what's what.