gpt4 book ai didi

git推送到远程: commits are going through but can't see files?

转载 作者:行者123 更新时间:2023-12-04 18:38:22 25 4
gpt4 key购买 nike

我已经在远程服务器上设置了一个裸仓库并且可以推送到它,但是当我完成后我没有看到远程上的任何文件....这是我推送时看到的内容:

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$

当我 ssh 进入时,我“推送”的文件不存在。有任何想法吗?

最佳答案

正如 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com