How to push the code cloned from github to another platform? For example, upload it to code cloud? The environment is IjIdea
过去多啦不再A梦2017-05-02 09:53:03
git remote add REMOTE_NAME ANOTHER_REPO_URL
git push REMOTE_NAME BRANCH_NAME
世界只因有你2017-05-02 09:53:03
Which remote warehouse you upload (whether it is Code Cloud, Github or other hosting platforms) is mainly related to the settings of your local warehouse. A local warehouse can add multiple remote warehouses. If you have the git command line installed on your computer, you can use the following command to view the remote repository you are currently associated with:
git remote -v
If you want to add another remote warehouse, first you need to know the url of the remote warehouse, and then use:
git remote add <name> <url-of-remote>
Add a remote warehouse, <name>
refers to the alias of the remote warehouse, such as origin, mayun, it can be anything, as long as you can understand it yourself. The second parameter is the url of the remote warehouse.
When you use git push
push, you should specify the remote repository:
git push <name of remote repository> <name of branch>
The first parameter is the alias of the remote warehouse we just mentioned, such as the commonly used origin, etc., and the latter parameter is the branch name.
The above method is for the git command line. I just realized that you may be using the git plug-in that comes with IED, so I will make some simple additions here. Since I have not used IjIdea, I just guess that you can find the settings for the remote warehouse in the git menu item. I strongly recommend that you use the git command line, because it can complete many operations that cannot be completed by the graphical interface and is very flexible.
PHP中文网2017-05-02 09:53:03
Open the config file in the .git
directory and add a remote. When pushing, you can push it to the new remote, or you can push it to the old one, whatever.
黄舟2017-05-02 09:53:03
First you need to create a new remote warehouse (bare library) on another platform
git init --bare (then use the warehouse address as the subsequent url)
Then you can add a new remote warehouse address locally
git remote add new_origin [url]
Has nothing to do with IjIdea
PHPz2017-05-02 09:53:03
The process is the same as github, you just need to replace the push address