get repoint to new remote repository

試著忘記壹切 提交于 2020-06-28 02:09:52

问题


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. repoint where my local repo considers "master" or "origin" to exist to our company URL
  2. to a git push (I think that is correct) of the code to this blank repository.

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.

How do I do #1 and #2?


回答1:


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

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

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.




回答2:


git remote set-url origin url/to/company/repo will change what the origin repository URL is. For the second part, you'll first need to initialize a bare repository at that URL, and then you can push to it.



来源:https://stackoverflow.com/questions/33327966/get-repoint-to-new-remote-repository

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!