一份代码能否同时托管于BAE和github?

浏览:30日期:2023-11-01

问题描述

在本地仅保存一份代码的时候能否同时托管于github与BAE?

假如github上有github.com/userName/projectName,同时自己在BAE上也有同名应用projectName时,如何才能保持这两个远程仓库公用一份本地代码来开发上传?

本人git新手,还望大神赐教。

问题解答

回答1:

http://blog.codepiano.com/2013/07/03/push-multi-remote-repositories/

用这个方法的话就不用push两次了,一次push就上传到所有的仓库。

回答2:

新增两个远程源:

git remote add github github.com/userName/projectNamegit remote add bae path.com/projectname

git commit 后分别提交到两个远程源去(默认本地master分支)。

git push github mastergit push bae master

相关文章: