Where does Git store remote tracking branches
I have to Git repos repo1
and repo2
. There are three branches master
, alpha
and beta
in repo1
. repo2
clones from repo1
.
In repo2
, I can see remote tracking branches with git branch -a
:
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/alpha
remotes/origin/beta
But the folder .git/refs/remotes/origin/
in repo2
only has a single file HEAD
, whose content is:
ref: refs/remotes/origin/master
So this HEAD
is a symbolic ref. But why does it point to a ref that doesn't exist? BTW, where does repo2
store the information of alpha
and beta
? (repo2
knows alpha
and beta
because it displays them in git branch -a
.)
git
add a comment |
I have to Git repos repo1
and repo2
. There are three branches master
, alpha
and beta
in repo1
. repo2
clones from repo1
.
In repo2
, I can see remote tracking branches with git branch -a
:
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/alpha
remotes/origin/beta
But the folder .git/refs/remotes/origin/
in repo2
only has a single file HEAD
, whose content is:
ref: refs/remotes/origin/master
So this HEAD
is a symbolic ref. But why does it point to a ref that doesn't exist? BTW, where does repo2
store the information of alpha
and beta
? (repo2
knows alpha
and beta
because it displays them in git branch -a
.)
git
Which version are you running? and did youinit
andfetch
, or justclone
. I ask because there are settings available for what should be fetched by default.
– Philip Oakley
Nov 3 '12 at 10:44
Is this all on the same machine, and could your installation be using symlinks rather than having a true second copy?
– Philip Oakley
Nov 3 '12 at 11:26
@PhilipOakley They're on the same machine. And the answer is pointed out below. I forgot the packed-refs issue...
– Cyker
Nov 4 '12 at 7:19
add a comment |
I have to Git repos repo1
and repo2
. There are three branches master
, alpha
and beta
in repo1
. repo2
clones from repo1
.
In repo2
, I can see remote tracking branches with git branch -a
:
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/alpha
remotes/origin/beta
But the folder .git/refs/remotes/origin/
in repo2
only has a single file HEAD
, whose content is:
ref: refs/remotes/origin/master
So this HEAD
is a symbolic ref. But why does it point to a ref that doesn't exist? BTW, where does repo2
store the information of alpha
and beta
? (repo2
knows alpha
and beta
because it displays them in git branch -a
.)
git
I have to Git repos repo1
and repo2
. There are three branches master
, alpha
and beta
in repo1
. repo2
clones from repo1
.
In repo2
, I can see remote tracking branches with git branch -a
:
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/alpha
remotes/origin/beta
But the folder .git/refs/remotes/origin/
in repo2
only has a single file HEAD
, whose content is:
ref: refs/remotes/origin/master
So this HEAD
is a symbolic ref. But why does it point to a ref that doesn't exist? BTW, where does repo2
store the information of alpha
and beta
? (repo2
knows alpha
and beta
because it displays them in git branch -a
.)
git
git
asked Nov 2 '12 at 22:12
CykerCyker
2,95453245
2,95453245
Which version are you running? and did youinit
andfetch
, or justclone
. I ask because there are settings available for what should be fetched by default.
– Philip Oakley
Nov 3 '12 at 10:44
Is this all on the same machine, and could your installation be using symlinks rather than having a true second copy?
– Philip Oakley
Nov 3 '12 at 11:26
@PhilipOakley They're on the same machine. And the answer is pointed out below. I forgot the packed-refs issue...
– Cyker
Nov 4 '12 at 7:19
add a comment |
Which version are you running? and did youinit
andfetch
, or justclone
. I ask because there are settings available for what should be fetched by default.
– Philip Oakley
Nov 3 '12 at 10:44
Is this all on the same machine, and could your installation be using symlinks rather than having a true second copy?
– Philip Oakley
Nov 3 '12 at 11:26
@PhilipOakley They're on the same machine. And the answer is pointed out below. I forgot the packed-refs issue...
– Cyker
Nov 4 '12 at 7:19
Which version are you running? and did you
init
and fetch
, or just clone
. I ask because there are settings available for what should be fetched by default.– Philip Oakley
Nov 3 '12 at 10:44
Which version are you running? and did you
init
and fetch
, or just clone
. I ask because there are settings available for what should be fetched by default.– Philip Oakley
Nov 3 '12 at 10:44
Is this all on the same machine, and could your installation be using symlinks rather than having a true second copy?
– Philip Oakley
Nov 3 '12 at 11:26
Is this all on the same machine, and could your installation be using symlinks rather than having a true second copy?
– Philip Oakley
Nov 3 '12 at 11:26
@PhilipOakley They're on the same machine. And the answer is pointed out below. I forgot the packed-refs issue...
– Cyker
Nov 4 '12 at 7:19
@PhilipOakley They're on the same machine. And the answer is pointed out below. I forgot the packed-refs issue...
– Cyker
Nov 4 '12 at 7:19
add a comment |
2 Answers
2
active
oldest
votes
The refs are probably "packed" in .git/packed-refs
.
2
git help pack-refs
clarifies everything. Thanks!
– Cyker
Nov 3 '12 at 4:05
add a comment |
The information is in .git/config
and is updated by tools like git remote
when you add or modify remotes. There is a manual page on git-config
. If you search for "tracking branches" you'll see details of how they are configured.
This is false. Remote tracking branches are not stored in.git/config
. All branches are stored in.git/refs/
or.git/packed-refs
. Only tracking metadata for local branches and fetch and push refspecs are stored in.git/config
.
– CB Bailey
Nov 2 '12 at 23:48
@CharlesBailey: The word "tracking" in the question seemed to be the most specific part of the request, so I focused on the tracking metadata.
– Ben Jackson
Nov 3 '12 at 1:22
This fixed my issue: visual studio 2013 current branch does not have an upstream branch configured
– JohnWrensby
Dec 22 '17 at 1:55
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f13203728%2fwhere-does-git-store-remote-tracking-branches%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The refs are probably "packed" in .git/packed-refs
.
2
git help pack-refs
clarifies everything. Thanks!
– Cyker
Nov 3 '12 at 4:05
add a comment |
The refs are probably "packed" in .git/packed-refs
.
2
git help pack-refs
clarifies everything. Thanks!
– Cyker
Nov 3 '12 at 4:05
add a comment |
The refs are probably "packed" in .git/packed-refs
.
The refs are probably "packed" in .git/packed-refs
.
answered Nov 2 '12 at 23:27
CB BaileyCB Bailey
514k78555611
514k78555611
2
git help pack-refs
clarifies everything. Thanks!
– Cyker
Nov 3 '12 at 4:05
add a comment |
2
git help pack-refs
clarifies everything. Thanks!
– Cyker
Nov 3 '12 at 4:05
2
2
git help pack-refs
clarifies everything. Thanks!– Cyker
Nov 3 '12 at 4:05
git help pack-refs
clarifies everything. Thanks!– Cyker
Nov 3 '12 at 4:05
add a comment |
The information is in .git/config
and is updated by tools like git remote
when you add or modify remotes. There is a manual page on git-config
. If you search for "tracking branches" you'll see details of how they are configured.
This is false. Remote tracking branches are not stored in.git/config
. All branches are stored in.git/refs/
or.git/packed-refs
. Only tracking metadata for local branches and fetch and push refspecs are stored in.git/config
.
– CB Bailey
Nov 2 '12 at 23:48
@CharlesBailey: The word "tracking" in the question seemed to be the most specific part of the request, so I focused on the tracking metadata.
– Ben Jackson
Nov 3 '12 at 1:22
This fixed my issue: visual studio 2013 current branch does not have an upstream branch configured
– JohnWrensby
Dec 22 '17 at 1:55
add a comment |
The information is in .git/config
and is updated by tools like git remote
when you add or modify remotes. There is a manual page on git-config
. If you search for "tracking branches" you'll see details of how they are configured.
This is false. Remote tracking branches are not stored in.git/config
. All branches are stored in.git/refs/
or.git/packed-refs
. Only tracking metadata for local branches and fetch and push refspecs are stored in.git/config
.
– CB Bailey
Nov 2 '12 at 23:48
@CharlesBailey: The word "tracking" in the question seemed to be the most specific part of the request, so I focused on the tracking metadata.
– Ben Jackson
Nov 3 '12 at 1:22
This fixed my issue: visual studio 2013 current branch does not have an upstream branch configured
– JohnWrensby
Dec 22 '17 at 1:55
add a comment |
The information is in .git/config
and is updated by tools like git remote
when you add or modify remotes. There is a manual page on git-config
. If you search for "tracking branches" you'll see details of how they are configured.
The information is in .git/config
and is updated by tools like git remote
when you add or modify remotes. There is a manual page on git-config
. If you search for "tracking branches" you'll see details of how they are configured.
answered Nov 2 '12 at 22:21
Ben JacksonBen Jackson
60.4k776131
60.4k776131
This is false. Remote tracking branches are not stored in.git/config
. All branches are stored in.git/refs/
or.git/packed-refs
. Only tracking metadata for local branches and fetch and push refspecs are stored in.git/config
.
– CB Bailey
Nov 2 '12 at 23:48
@CharlesBailey: The word "tracking" in the question seemed to be the most specific part of the request, so I focused on the tracking metadata.
– Ben Jackson
Nov 3 '12 at 1:22
This fixed my issue: visual studio 2013 current branch does not have an upstream branch configured
– JohnWrensby
Dec 22 '17 at 1:55
add a comment |
This is false. Remote tracking branches are not stored in.git/config
. All branches are stored in.git/refs/
or.git/packed-refs
. Only tracking metadata for local branches and fetch and push refspecs are stored in.git/config
.
– CB Bailey
Nov 2 '12 at 23:48
@CharlesBailey: The word "tracking" in the question seemed to be the most specific part of the request, so I focused on the tracking metadata.
– Ben Jackson
Nov 3 '12 at 1:22
This fixed my issue: visual studio 2013 current branch does not have an upstream branch configured
– JohnWrensby
Dec 22 '17 at 1:55
This is false. Remote tracking branches are not stored in
.git/config
. All branches are stored in .git/refs/
or .git/packed-refs
. Only tracking metadata for local branches and fetch and push refspecs are stored in .git/config
.– CB Bailey
Nov 2 '12 at 23:48
This is false. Remote tracking branches are not stored in
.git/config
. All branches are stored in .git/refs/
or .git/packed-refs
. Only tracking metadata for local branches and fetch and push refspecs are stored in .git/config
.– CB Bailey
Nov 2 '12 at 23:48
@CharlesBailey: The word "tracking" in the question seemed to be the most specific part of the request, so I focused on the tracking metadata.
– Ben Jackson
Nov 3 '12 at 1:22
@CharlesBailey: The word "tracking" in the question seemed to be the most specific part of the request, so I focused on the tracking metadata.
– Ben Jackson
Nov 3 '12 at 1:22
This fixed my issue: visual studio 2013 current branch does not have an upstream branch configured
– JohnWrensby
Dec 22 '17 at 1:55
This fixed my issue: visual studio 2013 current branch does not have an upstream branch configured
– JohnWrensby
Dec 22 '17 at 1:55
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f13203728%2fwhere-does-git-store-remote-tracking-branches%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Which version are you running? and did you
init
andfetch
, or justclone
. I ask because there are settings available for what should be fetched by default.– Philip Oakley
Nov 3 '12 at 10:44
Is this all on the same machine, and could your installation be using symlinks rather than having a true second copy?
– Philip Oakley
Nov 3 '12 at 11:26
@PhilipOakley They're on the same machine. And the answer is pointed out below. I forgot the packed-refs issue...
– Cyker
Nov 4 '12 at 7:19