Django
Django

Reputation: 181

Git - Remote Head not updating properly

I'm facing a weird issue with git. My pushes to a remote git repository is not happening as expected. When I do a push to the remote repository, only the changes in the push that was done just before the latest push are reflected in the remote repository. I suspect that my remote's HEAD is not pointing to the latest commit. Instead, it points to the the previous push and hence the anomaly. The following is my branch list.

(ENV)machine:~/Production-git/XXXX_tool$ git branch -a
 * master
   remotes/origin/HEAD -> origin/master
   remotes/origin/master 

I don't understand what the above represents.

I'm pretty sure that when I push the changes, it is actually updating the the remote repository(since when i do a 'git diff origin master', it doesn't show any difference). But since the Head lags by one push, when I clone the repository, I don't get the latest changes.

It would be great if anyone could help me fix this issue?

Upvotes: 2

Views: 1563

Answers (1)

Raja Simon
Raja Simon

Reputation: 10305

Do with initially like how you start the git.

git init

but i know that is not the solution ...

try below commands for updating remote head

git remote set-head $REMOTE_NAME $BRANCH

like that git remote set-head origin develop

Upvotes: 3

Related Questions