MPS 2017.3 Help

Manage projects hosted on GitHub

MPS allows you to manage projects controlled by Git that are hosted on GitHub without leaving the IDE.

Register a GitHub account in MPS

To retrieve data from a repository hosted on GitHub, and to be able to share your projects, you need to register your GitHub account in MPS. You can also create an account on GitHub without leaving the IDE if you do not have one yet.

In either case, MPS remembers your login and password, so you do not have to specify your credentials each time you retrieve data from a remote, or push your commits.

Register an existing GitHub account

GitHub offers two-factor authentication to improve the protection of user accounts.

If you enable two-factor authentication and you use SSH to access your repositories, you can choose any authentication type - password or token.

If you use the HTTPs protocol to access your remote repositories on GitHub, you need to configure an Access token and use it to authenticate, otherwise remote Git operations will fail. When prompted for credentials, either enter the token as your username and leave the password field empty, or specify the token instead of your password.

To register your account, do the following:

  1. Invoke the Settings dialog (N/A) and select Version Control | GitHub in the left pane.
  2. Select the type of authentication that you want to use from the Auth Type drop-down list:
    • Password. If this option is selected and you have two-factor authentication enabled in your GitHub account settings, you will be asked to enter an authentication code each time MPS requires you to log in to your GitHub account.
    • Token (recommended by GitHub for authentication from third-party applications, as it does not require MPS to remember your password).
  3. Specify your credentials depending on the selected authentication type, and click OK.

Create a new GitHub account

  1. Invoke the Settings dialog (N/A) and select Version Control | GitHub in the left pane.
  2. Click the Sign up link.
  3. On the Sign up for GitHub page that opens in the browser, choose the account plan (free or paid), and specify the requested information. When you are done creating an account, the GitHub Welcome Page is displayed.
  4. Return to GitHub settings and specify your credentials for MPS to register them.

Checkout a project from GitHub

MPS allows you to check out (clone) a repository from GitHub and create a new project based on it:

  1. From the main menu, choose VCS | Checkout from Version Control | GitHub.
  2. In the Clone Repository dialog that opens, specify the URL of the repository that you want to clone, or select a repository from the list that contains all GitHub projects associated with your account and the organization that your account belongs to.
  3. In the Parent Directory field, specify the path where the folder for your local Git repository will be created.
  4. In the Directory Name field, specify the name of the folder into which the repository will be cloned.
  5. Click Clone. If you want to create a MPS project based on the sources you have cloned, click Yes in the confirmation dialog. Git root mapping will be automatically set to the project root directory.

Share a project on GitHub

If you want to add a remote repository for your project on GitHub, do the following:

  1. Open the project you want to share.
  2. From the main menu, choose VCS | Import into Version Control | Share Project on GitHub.

    If you have already registered your login and password in MPS, connection to GitHub will be established using these credentials.

    If you have not registered your GitHub credentials in MPS, the Login to GitHub dialog opens. Specify your login and password, or create a new account there.

  3. When connection to GitHub has been established, the Share Project on GitHub dialog opens. Specify the new repository name and enter a description of your project's main functionality.

    You can select the Private option if you do not want to allow public access to your repository for other GitHub users (note that this option is unavailable for free accounts).

  4. Click Share to initiate a new repository and upload project sources to it.

Contribute to somebody else's projects

If you want to contribute to a project hosted on GitHub that you do not have rights to push to, follow this workflow:

  • Create a fork of the project you want to contribute to, i.e. a copy of the original repository on GitHub.
  • Clone this fork to create a local repository.
  • Make changes to your copy of the original project.
  • When you are ready to share the results of your work, rebase your fork on the current HEAD of the master branch in the original project to make sure your changes do not conflict with new commits that were pushed after you created your fork.
  • Create a pull request so that you can tell others about the changes you've made, and ask for comments or review. Note that a pull request is merged into the original repository only after approval.

Fork a project

Open the project that you want to fork on GitHub and click github fork

A copy of the original project will be created under your account. To make changes to this project, you need to clone it to create a local repository.

Watch this video tutorial on how to keep your fork of a project up to date:

Rebase a fork

From the main menu, choose VCS | Git | Rebase my GitHub fork. Your fork will be rebased onto the HEAD commit in the master branch of the original project your created your fork from.

Create a pull request

By creating a pull request, you tell others about the changes you've pushed to your fork, so that they can be reviewed, discussed, and integrated into the base branch. To create a pull request, do the following:

  1. From the main menu, choose VCS | Git | Create Pull Request. The Create Pull Request dialog opens.
  2. Under Base Fork, specify the project that you want to send the pull request to. Either select a repository from the list populated by MPS, or click Select Other Fork.
  3. Under Base Branch, specify the branch in the target project that your changes will be applied to. Click Show Diff to review the list of commits that will be included in the pull request. To view a commit details, select it and switch to the Log tab of the Version Control tool window, where you can see a list of files included in the selected commit, view diff, etc.
  4. Specify the name for your pull request in the Title field, and, optionally, provide a description of the changes to be applied through your request.

Share code by using gists

Gists allow you to share your code. You can share code snippets, entire files, or even applications. You can also use gists to save and share console output when running, debugging, or testing your code.

To create a gist, do the following:

  1. Select a code fragment in the editor, or files and folders in the Project tool window. To save console output to a gist, right-click anywhere in the tool window or tab that contains that output.
  2. On the context menu of the selection, choose Create Gist.
  3. In the Create Gist dialog that opens, specify the name for your gist under Filename, and enter a description of the code you are going to publish.
  4. Select the Private option to create the so-called secret gist. Secret gists are not searchable and do not show up in Discover. They can only be used for your own purposes, as you cannot share them.

    If you want to create a public gist, make sure this option is deselected. Public gists are searchable, and they show up in Discover where people can browse newly appearing gists. Use public gists if you want other people to be able to find and see your code.

  5. If you want to create an anonymous gist, select the Anonymous option. Anonymous gists can be both public or private.
  6. If you want to open the newly created gist in your default browser, select the Open in browser option and click OK.

Jump to the GitHub version of a file

You can jump from the MPS to the GitHub version of a file. MPS detects which branch is currently active, and opens the GitHub copy of the selected file in the corresponding branch.

To view the remote copy of a file, select it in the editor or in the Project view, and choose Open on GitHub from the context menu of the selection. The remote version of the file in the current branch will open in the browser.

Last modified: 6 December 2017