作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经在远程服务器上设置了一个裸仓库并且可以推送到它,但是当我完成后我没有看到远程上的任何文件....这是我推送时看到的内容:
my-macbook-pro:myapp me$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: www/index.php
#
no changes added to commit (use "git add" and/or "git commit -a")
my-macbook-pro:myapp me$ git add .
my-macbook-pro:myapp me$ git commit -m 'test'
[master 57e4b86] test
1 files changed, 2 insertions(+), 1 deletions(-)
my-macbook-pro:myapp me$ git push
me@myapp.com's password:
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 368 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)
To ssh://me@myapp.com:1111/var/www/myapp.git
ce07e61..57e4b86 master -> master
my-macbook-pro:myapp me$
最佳答案
正如 Krelin 和 Ray 已经提到的,裸存储库不会包含文件本身。这是一个功能,而不是错误,因为它避免了潜在的困惑。但是,例如,如果您想在服务器上更新您的网站,则此功能会使简单的推送无法使用。
一种解决方案是推送到服务器上的存储库,然后使用 Hook 自动更新目标文件夹中的文件。 Digital Ocean 有一个很好的教程,解释如何在这里做他的:
https://www.digitalocean.com/community/tutorials/how-to-set-up-automatic-deployment-with-git-with-a-vps
关于git推送到远程: commits are going through but can't see files?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8606422/
我是一名优秀的程序员,十分优秀!