Man*_*dan 20
使用git,您可以post-commit
在每次提交后使用钩子进行推送.为此,您需要post-commit
在.git/hooks
目录中添加可执行脚本.例如
#!/bin/sh
#
# An example hook script that is called after a successful
# commit is made.
#
# To enable this hook, rename this file to "post-commit".
git push --mirror remote
Run Code Online (Sandbox Code Playgroud)
Where remote
指的是您要推送的远程仓库的名称.
cron
如果您愿意,您还可以设置每小时执行此脚本.
更新
Mercurial也有钩子(但当然).这是相关文档.我没有使用Mercurial,所以你必须自己解决.