简体   繁体   English

本地主分支上的Git-链接有效,在实时版本上不起作用

[英]Git- link on local master branch works, doesn't work on live version

I am working on a Python/ Django project, using Git to manage the version control. 我正在使用Git管理版本控制的Python / Django项目。

I'm currently having an issue with some inconsistency between the master branch on my local machine and the live master branch on the server... 我目前有与之间的一些矛盾问题master分支我的本地机器上,并现场master服务器上的支...

I fixed a bug on my local machine earlier, and pushed the changes to the server, however, a link on one of the pages on the live version on the server is now no longer working, even though it is on my local version... 我之前在本地计算机上修复了一个错误,然后将更改推送到服务器上,但是,即使服务器在实时版本上,该服务器上实时版本的页面之一上的链接也不再起作用。 。

The link is at: www.mysite.co.uk/costing/id/ - when I click on the link 'Reports', I get an error page that says: 链接位于:www.mysite.co.uk/costing/id/-单击“报告”链接时,出现错误页面,显示:

TemplateSyntaxError at /costing/6108/payment-report/overview/ / costing / 6108 / payment-report / overview /处的TemplateSyntaxError

Invalid block tag on line 87: 'date_to_display', expected 'elif', 'else' or 'endif'. 第87行的无效代码块:“ date_to_display”,预期的“ elif”,“ else”或“ endif”。 Did you forget to register or load this tag? 您是否忘记注册或加载此标签?

But on my local machine, on the master branch, this link works correctly. 但是在我的本地计算机的master分支上,此链接可以正常工作。

Having looked at the template where the live version is complaining about the the invalid block tag , I can see that it is in the block: 查看了实时版本抱怨invalid block tag的模板后,我可以看到它位于块中:

{% block content_payment_schedule %}
    {% if not webview %}
        <div>
            <table>
                <tr>
                    ...
                </tr>
                <tr>
                    <td>
                        <span class="project-name">{{project.project_name|upper}}</span>
                    </td>
                    <!-- Display today's date in the header -->
                    <td> {{ date_to_display }}</td>
                </tr>
            </table>
        </div>  
    {% endif %}
    ...
{% endblock content_payment_schedule %}

This was something that I had previously added to the code (to display the date in the header of a PDF generated by clicking a link), and has been working up until now... 这是我以前添加到代码中的内容(用于在通过单击链接生成的PDF的标题中显示日期),并且一直在工作……

When I browse to: localhost:8000/costing/id/ and click on the same 'Reports' link, I am taken to the reports page at: localhost:8000/costing/id/payment-report/overview/ (which displays a 'tabbed content' area, with tabs for various reports, with the 'overview' tab automatically selected). 当我浏览到:localhost:8000 / costing / id /并单击相同的“报告”链接时,我被带到以下报告页面:localhost:8000 / costing / id / payment-report / overview /(显示一个“选项卡式内容”区域,带有用于各种报告的选项卡,并自动选择了“概述”标签。

From local machine, while on master branch, if I try running 如果我尝试运行,则从本地计算机在master分支上

git commit -m 'message about commit' , & then git commit -m 'message about commit' ,然后

git push origin master

Git displays a message telling me that: Git显示一条消息,告诉我:

Everything up-to-date 一切都是最新的

git status displays a message saying: git status显示一条消息:

On branch master 在分支机构主管

nothing to commit, working directory clean 无需提交,工作目录干净

So why is it that I am getting this TemplateSyntaxError on the live version, when my local version works correctly, and the version on the server is up-to-date with my local version? 那么,当本地版本可以正常工作并且服务器上的版本与本地版本最新时,为什么在实时版本上却收到此TemplateSyntaxError

Now for your local repo, git status says: 现在对于您的本地仓库,git status表示:

On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean

Then you can fetch from remote repo by git fetch origin , and use git status to show the local master branch. 然后,您可以通过git fetch origin从远程仓库git fetch origin ,并使用git status显示本地master分支。 If it says, 如果说

On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
  (use "git pull" to update your local branch)
nothing to commit, working tree clean

that means, your local master branch is not the newest version. 这意味着您的本地master分支不是最新版本。 If you want the live version (remote master branch) stay same with local master branch, you can use git push -f origin master . 如果您希望实时版本(远程master分支)与本地master分支保持相同,则可以使用git push -f origin master

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

相关问题 Git-本地主分支似乎已损坏 - Git- local master branch appears to be broken 在本地分支上进行Git更改,检出了master,而master现在已损坏 - Git- made changes on a local branch, checked out master, and master is now broken Git本地主分支与最新版本的显示方式不同 - Git local master branch displays differently to live version, even though it's up-to-date 无法使用Git Push Heroku Master推送本地更改 - Unable to push local changes live using Git Push Heroku Master __包含过滤器不适用于mysql,不适用于本地SQLite数据库 - __contains filter doesn't work on mysql, works on local SQLite db 我可以忽略整个分支来创建一个与实时服务器连接的本地分支,并将调试设置为True吗? - Can I git ignore an entire branch to create a local branch that interfaces with live server, with debug set to True.? 单击 email 中的链接时,Django allauth 密码重置不起作用,否则有效 - Django allauth password reset doesn't work when clicking the link from email, but works otherwise Django 迁移工作,但不反映在现场 - Django migrate works but doesn't reflect on live site Django:Bootstrap按钮链接不起作用 - Django: Bootstrap button link doesn't work git-了解diff命令的输出 - Git- understanding the output of diff command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM