IntelliJ IDEA 2016.3 Help

Committing Changes to a Local Git Repository

This topic describes how to commit changes to a local Git repository. For information on uploading changes to a remote repository, see Pushing Changes to the Upstream (Git Push).

To commit changes to a local repository

  1. Open the Version Control tool window by pressing Alt+9 or choosing View | Tool Windows | Version Control.
  2. In the Local Changes tab, select the files or folders you want to commit.
  3. Open the Commit Changes dialog box by doing one of the following:
    • On the tool window toolbar, click the Commit Changes button Icon.
    • On the main menu, choose VCS | Commit Changes.
    • On the main menu, choose VCS | Git | Commit File.
    • Press Ctrl+K.
  4. The Commit Changes dialog lists all files that have changed since the last commit. Select the check boxes next to the files you want to commit now.
  5. Add a comment in the Commit Message section and select the Before Commit options you want IntelliJ IDEA to perform on the files before committing them to the local repository.
  6. In the Git section, configure the following settings:
    • Use the Author drop-down list to specify the person who created the changes to be committed.
    • If you want to replace already published commit, select the check box Amend commit, see Git Basics: Undoing Things for details.
  7. Click Commit.

See Also

Last modified: 21 March 2017