重新指向新的远程存储库 [英] get repoint to new remote repository

查看:64
本文介绍了重新指向新的远程存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac OSX上运行.我已经拉下一个与Magento兼容的游民箱,然后通过git clone拉下了Magento 2.0代码库(开发分支),并成功安装了它.

I run on a Mac OSX. I have pulled down a vagrant box that is compatible with Magento, and then pulled down the Magento 2.0 codebase (develop branch) via git clone, and successfully installed it.

我现在有一个适合我们公司的已安装,已配置的代码库.我想做的是:

I now have an installed, configured codebase tailored to our company. What I wan to do is:

  1. 指出我的本地存储库认为母版"或原件"存在于我们公司网址中的位置
  2. 将代码的git push(我认为是正确的)推送到该空白存储库.

逻辑是,现在开发团队可以将其放入他们的无用信息框中,对结果数据库进行mysql导入,然后跳过安装.

The logic is, now the dev team can pull that into their vagrant box, do a mysql import of the resultant database, and skip the install.

我该如何做#1和#2?

How do I do #1 and #2?

推荐答案

对于#1,您可以使用git remote set-url,如下所示:

For #1, you can use git remote set-url, like so:

git remote set-url origin https://company.example.com/git/repo/path/

对于#2,您可以做一些不同的事情.如果只有要推送的master分支,则只需使用git push origin master.如果要推送所有分支,则可以使用git push origin refs/remotes/origin/*:refs/heads/*,它将把本地Git存储库知道的每个origin分支推送到origin.

For #2, you can do a few different things. If you only have a master branch to push, simply use git push origin master. If you want to push all branches, you can use git push origin refs/remotes/origin/*:refs/heads/*, which will push every origin-branch that your local Git repository knows about to origin.

这篇关于重新指向新的远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆