我在服务器上的预期目录中找不到任何文件,但 'hexo d' 运行正常
I can't find any file in the intended directory on my server, but 'hexo d' runs fine
我在我的服务器上设置了一个名为 'git' 的用户,我可以通过 'ssh -v git@xxx.xxx.xxx.xxx' 连接到服务器(Debian 9 x64)。
该网站的预期目录是“/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
然后我重新启动机器。
然后我修改了我本地机器上的_config.yml(Win10 x64)
deploy:
type: git
repo:
gcp: git@XXX.XXX.XXX.XXX:/home/git/hexo.git
branch: master
和 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
对我来说,看起来 fine.It 似乎没有发生任何错误。
但是当我试图访问我的站点时,我无法打开 it.When 我访问了“/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 -- .
注意末尾的 -- .
,这会强制文件在工作树中恢复。
我在我的服务器上设置了一个名为 'git' 的用户,我可以通过 'ssh -v git@xxx.xxx.xxx.xxx' 连接到服务器(Debian 9 x64)。 该网站的预期目录是“/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
然后我重新启动机器。 然后我修改了我本地机器上的_config.yml(Win10 x64)
deploy:
type: git
repo:
gcp: git@XXX.XXX.XXX.XXX:/home/git/hexo.git
branch: master
和 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
对我来说,看起来 fine.It 似乎没有发生任何错误。 但是当我试图访问我的站点时,我无法打开 it.When 我访问了“/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 -- .
注意末尾的 -- .
,这会强制文件在工作树中恢复。