简体   繁体   中英

Git local master branch displays differently to live version, even though it's up-to-date

I have been working on one of the pages of my Django project on my local Git branch, and am now looking to merge those changes with my master branch.

I have checked out my local master branch, and viewed the page locally in the browser, however, what is being displayed by my local master branch is different to what is being displayed on the live version of the project.

When I view this particular page on the live version, it displays a PDF embedded in a 'tabbed content' area within the webpage, and on one of the tabs, the PDF shows a table with four columns.

However, when I view this page on my local master branch, the same tab shows a PDF displaying a table with only two columns... (choosing which columns to display on the PDF was the thing that I was most recently working on).

I have tried running a git pull origin master from my local master branch, to make sure that my local version is the same as/ up-to-date with the version on the live server, and Git displays a message stating that it is

Already up-to-date

But if this is the case, then why am I not seeing all of the same columns displayed in the PDF table on my local version as I am in the live version?

Correct me if I am wrong, but I am assuming that when you say "live version", you are talking about the project on a server.

Once your merged your changes onto the local master branch from your local git branch (ie git merge your_local_random_git_branch ), these changes need to be pushed to your server not the other way around.

The reason why it shows

Already up to date.

after doing git pull origin master , is because the remote repository is behind the local master branch so there is nothing to change on the local master branch. What you want to do is to push your changes from the local master branch like this:

git push origin master

If the problem is from git then try:

git reset --hard origin/master

This will make sure your remote is the exact same as origin. If your code is fine then restart your local server and/or empty your browser cache.

First please check if local master branch is accordant with origin/master, use git checkout master and git log origin/master..HEAD

  1. If there has output, so you should reset local master to origin/master, just as Saksow said git reset --hard origin/master .
  2. If there is no output, that means, there is no issue for git doing version control, you need to check Django, maybe caused by some settings or something (since I'm not familiar with Django)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM