Git推送不会失败但不会起作用 [英] Git push doesn't fail but doesn't work

查看:49
本文介绍了Git推送不会失败但不会起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Git,但遇到了几个问题: 我可以推,我的同事可以推,相反.但是远程版本不是最新的:如果我在html中编写了TEST,则除了本地版本以外,其他任何人都看不到它. 我以为它可能来自遥控器上的分支...不是吗?

I'm using Git and I'm in front of a several problem: I can push, my coworkers can pull it, and the opposite. But the version which is on the remote is not up-to-date: if I write a TEST in the html, nobody could see it except on the local version... I thought it could come from the branch which is on the remote... isn't it ?

我将尝试更具体: 我有一个位于私人服务器上的私人仓库.该服务器用于托管网站.当我提交->拉->推一切都很好.当我的同事做同样的事情时,也很好.在我们的本地版本上,所有更改都像我的"TEST"测试一样.但是在服务器上,没有什么是最新的.是服务器上的错误分支还是其他错误?

EDIT 1 : I'll try to be more specific: I've a private repo which is on a private server. This server is used to host the website. When i commit -> pull -> push everything works great. When my coworker do the same, it's fine. On our local version, all the changes appear like my "TEST" test. But on the server, nothing is up to date. Is it the wrong branch, on the server or something?

PS:对不起,我的英语不是我的母语.

PS : Sorry for my english, it's not my native language.

推荐答案

如果要执行简单的"git push",则可能需要执行"git push origin branchname".当然,只要文件已提交.

If you are doing a plain 'git push' you may need to do 'git push origin branchname' instead. Provided the file is committed, of course.

更新:检查您的.git/config文件.您应该指定一个原点,并且您的分支应该引用原点.也许不匹配.

UPDATE: Check your .git/config file. You should have an origin specified and your branch should refer to origin. Maybe there is a mismatch.

[remote "origin"]
    url = [your github repo]
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "yourbranch"]
    remote = origin
    merge = refs/heads/yourbranch

这篇关于Git推送不会失败但不会起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆