CLion 2018.3 Help

Git

File | Settings | Version Control | Git for Windows and Linux
CLion | Preferences | Version Control | Git for macOS
Ctrl+Alt+S icons general settings svg


Use this page to specify the version control settings that will be applied to the directories of your project that are under Git control.

Item

Description

Path to Git executable

In this text box, specify the path to the Git executable file. Type the path manually or click Browse browseButton and specify the path in the dialog that opens.

Test

Click this button to verify the path to the Git executable file.

SSH executable

Use this drop-down list to specify the SSH version to be used with Git. The available options are:

  • Built-in: select this option to use the implementation provided by CLion.

  • Native: select this option to use native implementation.

    Note that on some platforms, the use of native ssh implementation may cause hang-up issues. You may need to configure a platform-specific ssh-askpass to receive prompts for passwords.

Execute branch operations on all roots

This option only becomes available if you have a multirooted project, i.e. there are several Git repositories within a single project.

Select this option if you want branch operations (such as checkout, merge, etc.) to be applied synchronously to all repositories within your project.

Commit automatically on cherry-pick

When you cherry pick a specific commit, the Commit Changes dialog is displayed. If the Commit automatically on cherry-pick option is selected, the selected commit is submitted silently on clicking the cherry-pick button platform impl icons cherryPick svg, without displaying the Commit Changes dialog.

Add the 'cherry-picked from <hash>' suffix when picking commits pushed to protected branches

Select this option if you want to keep a reference to the original commit when cherry-picking a commit from a protected branch. By default, no suffix is added when cherry-picking a change.

Warn if CRLF line separators are about to be committed

Select this option to enable smart handling of LF and CRLF line separators. CLion will analyze your configuration, warn you if you are about to commit CRLF into the repository, and suggest changing the core.autocrlf setting to true or input depending on your operating system.

If this option is deselected, you will have to fix issues with line endings manually using the Difference Viewer dialog.

Warn when committing in detached HEAD or during rebase

Select this option if you want CLion to display a warning when a commit is performed from a detached head or on rebase, as this may cause issues and code loss.

Update method

Use this drop-down list to choose the strategy to synchronize your local repository with the remote storage. The selected method will be used when the push operation is rejected (if the Auto-updated if push of the current branch was rejected option is enabled), or when you invoke the Update Project operation. The following options are available:
  • Merge: choose this option to have the merge strategy applied. The result is identical with that of running git fetch ; git merge or git pull --no-rebase.

  • Rebase: choose this option to have the rebase strategy applied. The result is identical with that of running git fetch ; git rebase or git pull --rebase.

  • Branch Default: choose this option to have the default command for the branch applied. The default command is specified in the branch.<name> section of the .git/config configuration file.

Auto-update if push of the current branch was rejected

Select this checkbox if you want the current branch to be updated automatically if the push operation from the current branch to its tracked branch is rejected.

If this option is deselected, CLion will display the Push Rejected dialog when pushing a branch is rejected because your local repository and the remote storage are not synchronized.

Note the following:

  • If you have never seen the Push Rejected dialog box before and you are enabling the checkbox initially, CLion will update the conflicting local branch silently by means of the merge operation.

  • If you have already encountered the Push Rejected dialog box and selected the Remember the update method choice... option, CLion saves your last choice (rebase or merge) and will apply it to update the conflicting local branch silently.

    Accordingly, to change the "remembered" setting, clear the checkbox, access the Push Rejected dialog box, select the Auto-update if push ... rejected option, and invoke another update strategy.

Show Push dialog for Commit and Push

Select this option if you want the Push dialog to be displayed after you've clicked Commit and Push in the Commit Changes dialog. Otherwise, your changes will be pushed automatically to the affected repository.

Show Push dialog only when committing to protected branches

Select this option if you only want to show the Push Changes dialog if you are pushing to a protected branch when you've clicked Commit and Push in the Commit Changes dialog. Otherwise, your changes will be pushed automatically to the affected repository.

Protected branches

If you want to disable the ability to force push changes for certain branches, list them here (this is a team-shared parameter that is stored in .idea/vcs.xml).

You can list several branches separated by a semicolon, or supply branch patterns as the input is treated as a list of regular expressions.

Last modified: 14 February 2019

See Also