[英]How can I get git in sync with remote master branch
我对为什么我的生产服务器似乎认为它领先于我的master分支感到困惑。 我使用Fabric进行部署,它在github的master分支上的服务器上运行git pull。 我不会在生产服务器本身上进行任何我知道的更改,并且我当然不会在生产服务器上进行提交。
git status
产生:
# On branch master
# Your branch is ahead of 'github/master' by 57 commits.
#
nothing to commit (working directory clean)
据我所知,生产服务器上的内容与我的开发环境中的master分支相匹配。 至少该站点的行为相同,但是我发现这一点令人不安。 关于如何将生产存储库与github master放在同一页面上并停止给我此消息的任何想法吗?
编辑(4/11/2013):
为了澄清一下,当我使用Fabric进行部署时,它会运行:
git pull github master
在服务器上。
我在上面原始问题中写的git状态结果在服务器上。 我从不在服务器上进行提交,仅在我将其推送到github的开发环境中提交,然后将其拉到服务器。 这就是为什么我很困惑。 我当然不想将任何东西从生产服务器推送到github,那是我工作流程的相反方向。
2nd编辑(4/11/2013):
这是fabfile git代码:
def prepare_remote_deployment_area():
"""Prepare the production host with updated resources"""
with cd(DEPLOYMENT_ROOT):
run('git pull github master')
这是从部署调用的:
def deploy():
"""Deploy an update (committed to GitHub) to production"""
check_git_status()
check_git_status(on_remote=True)
prepare_remote_deployment_area()
restart_uwsgi()
restart_nginx()
restart_celery()
同样,从我在开发环境中所做的更改显示在生产中的意义上来说,所有这些似乎都有效。 我只是不明白为什么生产存储库认为它远远领先于github master。
也许git pull
git pull origin master
更多信息
NAME
git-pull - Fetch from and merge with another repository or a local
branch
DESCRIPTION
Incorporates changes from a remote repository into the current
branch. In its default mode, git pull is shorthand for git fetch
followed by git merge FETCH_HEAD.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.