[git] 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?

This question is related to git repository checkin

The answer is


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!


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.


Examples related to git

Does the target directory for a git clone have to match the repo name? Git fatal: protocol 'https' is not supported Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) git clone: Authentication failed for <URL> destination path already exists and is not an empty directory SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 GitLab remote: HTTP Basic: Access denied and fatal Authentication How can I switch to another branch in git? VS 2017 Git Local Commit DB.lock error on every commit How to remove an unpushed outgoing commit in Visual Studio?

Examples related to repository

Kubernetes Pod fails with CrashLoopBackOff Project vs Repository in GitHub How to manually deploy artifacts in Nexus Repository Manager OSS 3 How to return a custom object from a Spring Data JPA GROUP BY query How do I force Maven to use my local repository rather than going out to remote repos to retrieve artifacts? How do I rename both a Git local and remote branch name? Can't Autowire @Repository annotated interface in Spring Boot How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning? git repo says it's up-to-date after pull but files are not updated Transfer git repositories from GitLab to GitHub - can we, how to and pitfalls (if any)?

Examples related to checkin

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