PyCharm 2016.3 Help

Managing Remotes

To be able to collaborate on your Git project, you need to configure remote repositories that you pull data from and push to when you need to share your work.

If you have cloned a remote Git repository, for example from GitHub, the remote is configured automatically and you do not have to specify it when you want to synchronize with it (i.e. when you perform a pull or a push operation).

However, if you create a Git repository by choosing VCS | Import into Version Control | Create Git Repository from the main menu, you need to add a remote repository to be able to push your commits and pull data from it.

Do the following:

  1. Invoke the Push Dialog when you are ready to push your commits by selecting VCS | Git | Push from the main menu, or press Ctrl+Shift+K.
  2. If you haven't added any remotes so far, the Define remote link will appear instead of a remote name. Click it to add a remote.

    Note that you can also add a remote from the Push dialog by clicking an existing remote's name.

  3. In the dialog that opens, specify the remote name and URL and click OK.

In some cases, you also need to add a second remote repository. This may be useful, for example, if you have cloned a repository that you do not have write access to, and you are going to push changes to your own fork of the original project. Another common scenario is that you have cloned your own repository that is somebody else's project fork, and you need to synchronize with the original project and pull changes from it.

Do the following:

  1. From the main menu, choose VCS | Git | Remotes. The Git Remotes dialog will open.
  2. Click the Add button /help/img/idea/new.png on the toolbar or press Alt+Insert.
  3. In the dialog that opens, specify the remote name and URL and click OK.

To edit a remote (for example, to change the name of the original project that you have cloned from origin to upstream if you are going to push to its fork), select it in the Git Remotes dialog and click the Edit button /help/img/idea/edit.png on the toolbar, or press Enter.

To remove a repository that is no longer valid, select it in the Git Remotes dialog and click the Remove button /help/img/idea/delete.png on the toolbar, or press Alt+Delete.

See Also

Last modified: 23 November 2016