跳至主要內容

文件同步

大约 1 分钟

文件同步

由于我用vsc远程过去服务器会由于莫名原因卡死,我只能采用在本地编写同步过去的方法,因为vite检测到变化能自动重载所以挺好的

方法一:git同步

参考git同步

安装git

apt install git

cd 到项目目录,运行

git init
git add .
git commit -m "init"
git config init.defaultBranch main
git config receive.denyCurrentBranch ignore
echo "#!/bin/bash
# Git checkout the branch that was pushed
GIT_WORK_TREE=`pwd` git checkout -f main
" > .git/hooks/post-receive
chmod +x .git/hooks/post-receive

于是在其它地方可以这样git clone,记得替换userremote/path/to/repo

git clone user@remote:/path/to/repo

方法二:rsync同步

用Cygwin安装rsync,把安装目录下的bin文件夹添加进windows的环境变量中,重启电脑

但是我没有成功(x)报错

rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [Receiver=3.2.7]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [sender=3.2.7]

不知道怎么搞

评论
  • 按正序
  • 按倒序
  • 按热度
Powered by Waline v3.0.0-alpha.10