I'm getting a big problem with GIT fetch...look this
$ git fetch
From server:project
422b4cb..a04c062 master -> origin/master
$ git show-ref
ba113be885e66a5306d1646cd3db0801170c04f8 refs/heads/alpha-release
a04c062261beeb4a951337ebb58745945cac3562 refs/heads/master
a04c062261beeb4a951337ebb58745945cac3562 refs/heads/test
a04c062261beeb4a951337ebb58745945cac3562 refs/remotes/origin/HEAD
ba113be885e66a5306d1646cd3db0801170c04f8 refs/remotes/origin/alpha-release
a04c062261beeb4a951337ebb58745945cac3562 refs/remotes/origin/master
And another git fetch
:
$ git fetch
From server:project
+ a04c062...422b4cb HEAD -> origin/HEAD (forced update)
$ git show-ref
ba113be885e66a5306d1646cd3db0801170c04f8 refs/heads/alpha-release
a04c062261beeb4a951337ebb58745945cac3562 refs/heads/master
a04c062261beeb4a951337ebb58745945cac3562 refs/heads/test
422b4cbac3db2784c8f6e94ffd99c7afcda9122d refs/remotes/origin/HEAD
ba113be885e66a5306d1646cd3db0801170c04f8 refs/remotes/origin/alpha-release
422b4cbac3db2784c8f6e94ffd99c7afcda9122d refs/remotes/origin/master
And another one...
$ git fetch
From server:project
422b4cb..a04c062 master -> origin/master
$ git show-ref
ba113be885e66a5306d1646cd3db0801170c04f8 refs/heads/alpha-release
a04c062261beeb4a951337ebb58745945cac3562 refs/heads/master
a04c062261beeb4a951337ebb58745945cac3562 refs/heads/test
a04c062261beeb4a951337ebb58745945cac3562 refs/remotes/origin/HEAD
ba113be885e66a5306d1646cd3db0801170c04f8 refs/remotes/origin/alpha-release
a04c062261beeb4a951337ebb58745945cac3562 refs/remotes/origin/master
And another git fetch
:
$ git fetch
From server:project
+ a04c062...422b4cb HEAD -> origin/HEAD (forced update)
$ git show-ref
ba113be885e66a5306d1646cd3db0801170c04f8 refs/heads/alpha-release
a04c062261beeb4a951337ebb58745945cac3562 refs/heads/master
a04c062261beeb4a951337ebb58745945cac3562 refs/heads/test
422b4cbac3db2784c8f6e94ffd99c7afcda9122d refs/remotes/origin/HEAD
ba113be885e66a5306d1646cd3db0801170c04f8 refs/remotes/origin/alpha-release
422b4cbac3db2784c8f6e94ffd99c7afcda9122d refs/remotes/origin/master
My refs/remotes/origin/HEAD
and refs/remotes/origin/master
always force update to 422b4cb
...
What happened? 422b4cb
... is a old commit.
Wow...after a big fight with GIT I fixed this issue just using:
git push origin :HEAD
The only other instance where I saw that kind of behavior was in this thread:
Looks like you have local branch '
HEAD
' (not the special refHEAD
) on remote side and that is messing it up.
ls-remote
'ing the repository shows 'refs/heads/HEAD
', right (there's also HEAD, that's the required special ref)?
Maybe commit 422b4cb
was when that branch called 'HEAD
' was introduced?
Note (7 years later): with Git 2.16 (Q1 2018), you won't be able to create a branch named HEAD anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With