Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.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:从公共github克隆到私有github_Git_Github_Version Control - Fatal编程技术网

git:从公共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 将更改从内

(重复注释)与以下内容无关:;我不需要多个位置,只需要在内部和公共github之间进行交互(结束语)

我正在寻找一个工作流:

  • 将repo从github.com克隆到内部github服务器(不是github.com上的私有repo)
  • 使用内部github服务器进行更改和测试
  • 可能会将更改从外部github拉到内部github
  • 审查更改,向原始github repo发送请求
什么git咒语将执行这三种交互

  • 从公共到内部github的克隆
  • 将更改从公共github拉到内部github
  • 将更改从内部推送到公共github

您在两台Git服务器之间的大多数管理都将在它们之间单独管理
远程
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