【问题标题】:Can not see changes using git push使用 git push 看不到更改
【发布时间】:2013-10-17 19:12:14
【问题描述】:

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

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

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

提前致谢!

【问题讨论】:

    标签: git github push


    【解决方案1】:

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

    见“all about "bare" repos”。

    您需要将post-receive hook 添加到您的裸仓库中才能更新实时站点 (like this one)。

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

    请参阅“unable to set GIT_WORK_TREE variable in a bare repository when using post_update hook”中的完整脚本。

    【讨论】:

      猜你喜欢
      • 2013-12-09
      • 2010-11-20
      • 1970-01-01
      • 2017-01-17
      • 2023-04-01
      • 2017-06-01
      • 2013-03-25
      • 2017-06-26
      • 1970-01-01
      相关资源
      最近更新 更多