Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git Bitbucket自动从远程存储库提取最新代码_Git_Bitbucket - Fatal编程技术网

Git Bitbucket自动从远程存储库提取最新代码

Git Bitbucket自动从远程存储库提取最新代码,git,bitbucket,Git,Bitbucket,我们有Bitbucket云远程服务器 我有数百台服务器,我必须从存储库中获取最新的代码 我发现以下命令可以从远程服务器获取最新代码 git fetch origin git diff origin/master git merge origin/master 我对Git世界很陌生 我们是否可以像每小时从远程存储库提取最新代码一样,在bitbucket门户中自动执行此任务 所有服务器都配置了到远程bitbucket服务器的无密码ssh连接 我可以在所有服务器的crontab中添加上面的fetch

我们有Bitbucket云远程服务器

我有数百台服务器,我必须从存储库中获取最新的代码

我发现以下命令可以从远程服务器获取最新代码

git fetch origin
git diff origin/master
git merge origin/master
我对Git世界很陌生

我们是否可以像每小时从远程存储库提取最新代码一样,在bitbucket门户中自动执行此任务

所有服务器都配置了到远程bitbucket服务器的无密码ssh连接


我可以在所有服务器的crontab中添加上面的fetch命令。但我想可能有简单的步骤来达到我的要求

Git本身不拉数据,因此您必须自己启动拉数据

如您所述,您可以执行
git fetch
,添加
--all
将一次获取所有遥控器

不执行3命令,只需运行一个命令:

# pull = fetch + merge
# get all the delta from the server and merge it into the local branch
git pull <remote> <branch name>
#pull=fetch+merge
#从服务器获取所有增量并将其合并到本地分支
吉特拉力
最好的解决方案是将脚本添加到crontab中,并每小时执行一次