使用git push无法看到更改 [英] Can not see changes using git push

查看:113
本文介绍了使用git push无法看到更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的PHP网站建立一个git环境。在我的centos服务器中,我创建了一个目录并使用 git init --bare --shared 来初始化git存储库。然后运行 git add。 git commit



在我的笔记本电脑中,我使用net beans IDE通过SSH获取git存储库的克隆。我添加了一些文件并提交,推送。这似乎没有问题。



我的问题是为什么我看不到在我的centos服务器中发生的任何更改。在原始存储库中,没有任何更改。我需要运行一些命令吗?



预先感谢!

解决方案

它是一个裸回购,这意味着它没有工作树,没有可见文件。

请参阅关于裸机回购的所有信息。



您需要在裸露的回购站中添加一个接收后挂钩,以便更新现场(<一个href =https://stackoverflow.com/a/18804440/6309>像这样一个)。

  GIT_WORK_TREE = / path / to / your / site git checkout -f 

请参阅完整脚本无法在使用 GIT_WORK_TREE 变量> post_update 钩子


I want to set up a git environment for my PHP website. In my centos server, I created a directory and using git init --bare --shared to initial the git repository. Then I run git add . and git commit.

In my laptop, i use net beans IDE to get a clone of the git repository through SSH. I added some files and commit, push. It seems no problems.

My question is why I can not see any changes happened in my centos server. In the original repository, there are nothing changed. Do I need to run some commands?

Thanks in advance!

解决方案

It is a bare repo, which means it has no working tree, no visible files.

See "all about "bare" repos".

You would need to add a post-receive hook to your bare repo in order to update a live site (like this one).

GIT_WORK_TREE=/path/to/your/site git checkout -f

See the full script in "unable to set GIT_WORK_TREE variable in a bare repository when using post_update hook".

这篇关于使用git push无法看到更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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