Push Ref Specifications
Reference URL:
Is “refs/heads/master” same as “refs/remotes/origin/master” in Git?
https://stackoverflow.com/questions/7541040/is-refs-heads-master-same-as-refs-remotes-origin-master-in-git
They are two different symbolic names that can point to different things.
refs/heads/master
is a branch in your working copy named master
. Frequently that is a tracking branch of refs/remotes/origin/master
because origin
is the default name for the remote created by git clone
and its primary branch is usually also named master
.
You can see the difference between them with
git rev-list refs/heads/master..refs/remotes/origin/master
which will be empty if they are the same and will otherwise list the commits between them.Found this configuration in eclipse:
Not sure what the different of:
refs/heads/master - refs/remotes/origin/master
vs
+refs/heads/*:refs/remotes/origin/*
is * = wildcard?
https://stackoverflow.com/a/7546794/676104
The key difference to understand is that the branches under
refs/heads/
are branches that, when you have one checked out, you can advance by creating new commits. Those under refs/remotes/
, however, are so-called "remote-tracking branches" - these refs just point to the commit that a remote repository was at the last time you did a git fetch <name-of-remote>
, or a successful git push
to the corresponding branch in that remote repository. (I wrote a blog post that talks about this difference at some length here.)https://longair.net/blog/2009/04/16/git-fetch-and-merge/
No comments:
Post a Comment