问题
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:
- repoint where my local repo considers "master" or "origin" to exist to our company URL
- 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