git:从公共github克隆到私有github
(重复注释)与以下内容无关:;我不需要多个位置,只需要在内部和公共github之间进行交互(结束语) 我正在寻找一个工作流:git:从公共github克隆到私有github,git,github,version-control,Git,Github,Version Control,(重复注释)与以下内容无关:;我不需要多个位置,只需要在内部和公共github之间进行交互(结束语) 我正在寻找一个工作流: 将repo从github.com克隆到内部github服务器(不是github.com上的私有repo) 使用内部github服务器进行更改和测试 可能会将更改从外部github拉到内部github 审查更改,向原始github repo发送请求 什么git咒语将执行这三种交互 从公共到内部github的克隆 将更改从公共github拉到内部github 将更改从内
- 将repo从github.com克隆到内部github服务器(不是github.com上的私有repo)
- 使用内部github服务器进行更改和测试
- 可能会将更改从外部github拉到内部github
- 审查更改,向原始github repo发送请求
- 从公共到内部github的克隆
- 将更改从公共github拉到内部github
- 将更改从内部推送到公共github
远程s
如果您明确地使用了推送
和拉送
,那么您可以定义一个非常合理的工作流
从公共到内部github的克隆
将更改从内部推送到公共github
可能重复的
# this will be a one-time setup
# first clone the public repo
cd /dir/where/you/want/your/repo
git clone <public github url> myRepo
cd myRepo
# create a remote to your internal Git server
git remote add internal <internal repo url>
# push to your internal repo
# (assuming you are working on the master branch)
git push internal master
# now you have effectively "cloned" the public repo
# to your internal server
# assuming you are on master branch
# and _not_ taking tracking branches
# into account (since IMO they complicate matters)
git checkout master
# pull from github
git pull origin master
# push to internal
git push internal master
git checkout master
git pull internal master
git push origin master