kch*_*kch 41 git version-control
基本上我想做点什么 git push mybranch to repo1, repo2, repo3
现在我只是多次打字,如果我急着推进,我只是将它们全部发送到后台 git push repo1 & git push repo2 &
我只是想知道我是否原生git
支持我想要做的事情,或者是否有一个聪明的脚本,或者可能是一种编辑本地repo配置文件的方式来说应该将分支推送到多个遥控器.
Ari*_*zis 79
你可以在git中为每个遥控器提供多个URL,即使该git remote
命令最近没有公开我检查过.在.git/config
,把这样的东西:
[remote "public"]
url = git@github.com:kch/inheritable_templates.git
url = kch@homeserver:projects/inheritable_templates.git
Run Code Online (Sandbox Code Playgroud)
现在你可以说" git push public
"立即推送到两个回购.
我所做的是有一个裸存储库,它存在于我推送的主目录中.然后,该存储库中的更新后挂钩将或rsyncs推送到其他几个公开可见的位置.
这是我的钩子/更新后:
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, make this file executable by "chmod +x post-update".
# Update static info that will be used by git clients accessing
# the git directory over HTTP rather than the git protocol.
git-update-server-info
# Copy git repository files to my web server for HTTP serving.
rsync -av --delete -e ssh /home/afranco/repositories/public/ afranco@slug.middlebury.edu:/srv/www/htdocs/git/
# Upload to github
git-push --mirror github
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6818 次 |
最近记录: |