问题描述
我有以下回购。
- DEV REPO:在我的开发机器上的一个目录中进行更改
- MAIN REPO:我的开发计算机上裸露的存储库,我从dev repo推送更改
- PRODUCTION REPO:主机上的存储库以从主repo中提取更新
-
我用 git remote add origin / Users / me / sites / main_repo
来设置主回购作为DEV回购的来源。 PRODUCTION repo在远程主机上。我是否可以使用同一命令的变体将MAIN回购作为PRODUCTION回购的来源?如果是,那么我想这个语法会包含一个IP地址。使用SSH
解决方案 >git remote add origin ssh:// login @ IP / path / to / repository
使用HTTP
git remote add origin http:// IP / path / to / repository
code>
然而,作为一个部署过程,有一个简单的
git pull
通常是一个 bad idea ,应该避免使用真正的部署脚本。
I have the following repos.
- DEV REPO: in a directory on my development machine where i make changes
- MAIN REPO: bare repository on my development machine to which i push changes from dev repo
- PRODUCTION REPO: repository on host machine to pull updates from the main repo
I used git remote add origin /Users/me/sites/main_repo
to set the MAIN repo as origin for the DEV repo. The PRODUCTION repo is on a remote host. Can i use a variation of the same command to set the MAIN repo as origin for the PRODUCTION repo also? If "yes", then i suppose the syntax would include an ip address. What would that look like?
解决方案 Using SSH
git remote add origin ssh://login@IP/path/to/repository
Using HTTP
git remote add origin http://IP/path/to/repository
However having a simple git pull
as a deployment process is usually a bad idea and should be avoided in favor of a real deployment script.
这篇关于设置一个git远程原点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!