Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git repo says it's up-to-date after pull but files are not updated

I have 3 repos. A bare repo which I use as a master repo, a dev repo in which I make and test changes, and prod repo from which scripts are executed in the prod environment.

After I have tested changes in the dev repo I push them to the bare repo and they are auto pulled down into the prod repo on a cronjob using a basic script (carrying out git pull command).

I followed through the above procedure for a change, but the altered file will not update in the prod repo.

  • The change is checked in and pushed in the dev repo
  • The pull has been done to the prod repo
  • The git logs for all repos are identical and all show the checkin for this change
  • git branch gives me "* master" for all repos
  • git status for all repos gives me: # On branch master nothing to commit, working directory clean
  • git pull gives me "Already up-to-date" for the dev & prod repos

Using git extensions for a graphical view, it appears each repo is up to date and at the head.

I've tried:

git checkout HEAD  
git pull origin master  
git reset --hard HEAD  
git reset --hard origin/master  
git reset origin/master  

Can anyone help here?

like image 730
bren Avatar asked Aug 20 '14 17:08

bren


People also ask

Why does git status says up to date but not?

When git status says up-to-date, it means "up-to-date with the branch that the current branch tracks", which in this case means "up-to-date with the local ref called origin/master ".

Why is git pull not updating?

You might have to synchronise with your fork directory first and then perform git pull on your local branch. Basically you have to rebase your fork copy to get in sync with remote master and perform git pull in your local copy. 2. Just try to rebase your local work copy to be in sync with remote master.

Why is git saying everything up to date?

What this means is that you can discard your temporary commits and merges by switching back to an existing branch (e.g. git checkout master ), and a later git prune or git gc would garbage-collect them. If you did this by mistake, you can ask the reflog for HEAD where you were, e.g.


3 Answers

Try this:

 git fetch --all
 git reset --hard origin/master

Explanation:

git fetch downloads the latest from remote without trying to merge or rebase anything.

Please let me know if you have any questions!

like image 120
Devarsh Desai Avatar answered Oct 12 '22 22:10

Devarsh Desai


For me my forked branch was not in sync with the master branch. So I went to bitbucket and synced and merged my forked branch and then tried to take the pull. Then it worked fine.

like image 28
Kartik Avatar answered Oct 12 '22 22:10

Kartik


I've been having the same issue since Git forced SSH. It was always fine before, but now when running Git Pull it keeps saying "Already up to date'.

I've run the commands above but it doesn't do anything. Git is a bit like Bluetooth. Great when it's working, but a pain when it's not. lol.

like image 23
Kamishiraishi Avatar answered Oct 13 '22 00:10

Kamishiraishi