Home  >  Q&A  >  body text

intellij-idea - 从github上clone的代码如何push到另外一个平台?例如上传到码云之类的?环境是IjIdea

从github上clone的代码如何push到另外一个平台?例如上传到码云之类的?环境是IjIdea

伊谢尔伦伊谢尔伦2727 days ago1189

reply all(6)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-02 09:53:03

    Step one:

    git remote add REMOTE_NAME ANOTHER_REPO_URL

    Step 2:

    git push REMOTE_NAME BRANCH_NAME

    reply
    0
  • 世界只因有你

    世界只因有你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.

    reply
    0
  • PHP中文网

    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.

    reply
    0
  • 黄舟

    黄舟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

    reply
    0
  • 迷茫

    迷茫2017-05-02 09:53:03

    Don’t know how to operate in idea?

    reply
    0
  • PHPz

    PHPz2017-05-02 09:53:03

    The process is the same as github, you just need to replace the push address

    reply
    0
  • Cancelreply