简体   繁体   English

Git本地主分支与最新版本的显示方式不同

[英]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 mastergit 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 . 如果有输出,则应将本地主服务器重置为origin / master,就像Saksow所说的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) 如果没有输出,则意味着进行版本控制的git没有问题,您需要检查Django,可能是由于某些设置或某些原因引起的(因为我对Django不熟悉)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 git pull origin master返回“已经更新”,即使不是 - git pull origin master returns “Already up-to-date” even though it isn't 本地主分支上的Git-链接有效,在实时版本上不起作用 - Git- link on local master branch works, doesn't work on live version Git-本地主分支似乎已损坏 - Git- local master branch appears to be broken 无法使用Git Push Heroku Master推送本地更改 - Unable to push local changes live using Git Push Heroku Master OpenShift Django git push不提供管理员用户名和密码-“一切都是最新的” - OpenShift Django git push not providing admin username and password - “Everything up-to-date” 在本地分支上进行Git更改,检出了master,而master现在已损坏 - Git- made changes on a local branch, checked out master, and master is now broken 我可以忽略整个分支来创建一个与实时服务器连接的本地分支,并将调试设置为True吗? - Can I git ignore an entire branch to create a local branch that interfaces with live server, with debug set to True.? django:刷新queryset结果缓存的最新方法是什么? - django: What's the up-to-date way to flush the queryset results cache? Django表单无法从db获取最新信息 - Django forms don't get up-to-date from db 一种在Django应用中实现Facebook登录的简单且最新的方法 - A simple and up-to-date way to implement Facebook login in a Django app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM