Git 我能';在我的服务器上的目标目录中找不到任何文件,但是';hexo d';运行良好

Git 我能';在我的服务器上的目标目录中找不到任何文件,但是';hexo d';运行良好,git,hexo,Git,Hexo,我在服务器上设置了一个名为“git”的用户,我可以通过“ssh-v”连接到服务器(Debian9x64)git@xxx.xxx.xxx.xxx'. 该网站的预期目录是“/home/www/hexo”,我有一个正确的Nginx服务器。 我创建了一个钩子文件: cd ~ git init --bare hexo.git vi ~/hexo.git/hooks/post-receive 进入 git --work-tree=/home/www/hexo --git-dir=/home/git/hex

我在服务器上设置了一个名为“git”的用户,我可以通过“ssh-v”连接到服务器(Debian9x64)git@xxx.xxx.xxx.xxx'. 该网站的预期目录是“/home/www/hexo”,我有一个正确的Nginx服务器。 我创建了一个钩子文件:

cd ~
git init --bare hexo.git
vi ~/hexo.git/hooks/post-receive
进入

git --work-tree=/home/www/hexo --git-dir=/home/git/hexo.git checkout -f
并授权

chmod +x ~/hexo.git/hooks/post-receive
cd ~
sudo chmod -R 777 /home/www/hexo
然后我重启机器。 然后我在本地机器(Win10 x64)上修改了_config.yml

和url。 当我运行命令“hexo cl&&hexo g&&hexo d”时,我得到了以下信息:

$ hexo d
INFO  Validating config
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
warning: LF will be replaced by CRLF in 2020/12/23/hello-world/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in 2020/12/23/my-first-blog/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/2020/12/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/2020/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in archives/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in css/main.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/algolia-search.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/bookmark.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/local-search.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/motion.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/next-boot.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/schemes/muse.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/schemes/pisces.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in js/utils.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in lib/anime.min.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in lib/font-awesome/css/all.min.css.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in lib/velocity/velocity.min.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in lib/velocity/velocity.ui.min.js.
The file will have its original line endings in your working directory
On branch master
nothing to commit, working tree clean
Everything up-to-date
Branch 'master' set up to track remote branch 'master' from 'git@34.94.20.213:/home/git/hexo.git'.
INFO  Deploy done: git
对我来说,它看起来很好。似乎没有发生任何错误。
但是当我试图访问我的网站时,我无法打开它。当我访问“/home/www/hexo”时,没有显示任何文件。我找不出原因。

尝试检查路径:

#!/bin/bash
echo "Executing post-receive hook"
unset GIT_DIR
git --work-tree=/home/www/hexo --git-dir=/home/git/hexo.git checkout -f -- .
请注意末尾的
-。
,这将强制在工作树中恢复文件

#!/bin/bash
echo "Executing post-receive hook"
unset GIT_DIR
git --work-tree=/home/www/hexo --git-dir=/home/git/hexo.git checkout -f -- .