相关疑难解决方法(0)

Git推送结账?

我想将我的文件直接推送到我的Web服务器.我添加了服务器testing并尝试了

git push testing
Run Code Online (Sandbox Code Playgroud)

但是我得到了这个错误.制作裸存储库的解决方案可行但我希望自动检出文件.我找到了这个脚本,但没有改变任何东西.

我可以在第三个裸存储库上传输更改,但这只需要很长时间:

client:
git commit -m "test" -a
git push origin
<password>

server:
git pull origin/master
Run Code Online (Sandbox Code Playgroud)

更新(2)

我在服务器上创建了一个新分支git branch testing.

同样在服务器上我创建.git/hooks/post-update了一个添加的:

echo "a" >> /home/pi/log
git update-server-info
git stash
git merge testing >> /home/pi/log
Run Code Online (Sandbox Code Playgroud)

在我运行的客户端上

git push testing HEAD:testing
Run Code Online (Sandbox Code Playgroud)

现在我的/home/pi/log包含:

a
Updating ae2f44b..04753a9
Fast-forward
 application/views/main/index.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Run Code Online (Sandbox Code Playgroud)

但文件没有改变.还有什么可能是错的?

git

6
推荐指数
1
解决办法
3024
查看次数

标签 统计

git ×1