[英]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. 我一直在本地Git分支上处理Django项目的页面之一,现在正在将这些更改与我的master分支合并。
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. 我已经签出了本地master分支,并在浏览器中本地查看了该页面,但是,本地master分支显示的内容与项目的实时版本中显示的内容不同。
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. 当我在实时版本上查看此特定页面时,它显示嵌入在网页内“选项卡式内容”区域中的PDF,并且在其中一个选项卡上,PDF显示具有四列的表格。
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). 但是,当我在本地主分支上查看此页面时,同一选项卡上显示的PDF仅显示一个只有两列的表...(选择PDF中要显示的列是我最近的工作)。
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 我尝试从本地master分支运行
git pull origin master
,以确保我的本地版本与实时服务器上的版本相同/最新,并且Git显示一条消息,指出它是
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? 但是,如果是这种情况,那么为什么在实时版本中我看不到本地表的PDF表中显示的所有相同列?
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. 一旦您将更改从本地git分支合并到本地master分支(即
git merge your_local_random_git_branch
),则需要将这些更改推送到服务器,而不是相反。
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. 在执行
git pull origin master
,是因为远程存储库在本地master分支后面,所以在本地master分支上没有任何更改。 What you want to do is to push your changes from the local master branch like this: 您要做的是像这样从本地master分支推送更改:
git push origin master
If the problem is from git then try: 如果问题来自git,请尝试:
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
首先请检查本地master分支是否符合origin / master,使用
git checkout master
和git log origin/master..HEAD
git reset --hard origin/master
. git reset --hard origin/master
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.