Where Git Stores Remote Tracking Branches

I need Git repos repo1 and repo2 . In repo1 there are three branches master , alpha and beta . repo2 clones from repo1 .

In repo2 I see remote tracking branches with git branch -a :

 remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/alpha remotes/origin/beta 

But the .git/refs/remotes/origin/ repo2 in repo2 has only one HEAD file, the contents of which:

 ref: refs/remotes/origin/master 

So this HEAD is a ref symbol. But why does this indicate a ref that does not exist? BTW, where repo2 store alpha and beta ? ( repo2 knows alpha and beta because it maps them to git branch -a .)

+6
source share
2 answers

refs are probably "packaged" in .git/packed-refs .

+6
source

Information is located in .git/config and is updated with tools such as git remote when adding or changing remotes. The git-config page contains a manual page. If you are looking for "tracking branches", you will see how they are configured.

+3
source

All Articles