GitHub Desktop tracks all changes to all files as you edit them. You can decide how to group the changes to create meaningful commits.

1. Choosing a branch and making changes

  1. At the top of the app, create a new branch, or next to the icon, choose an existing branch to compare your changes against.

    The branch selection menu

  2. Using your favorite text editor, such as Atom, make the necessary changes to files in your project.
  1. At the top of the app, create a new branch, or next to the icon, choose an existing branch to compare your changes against.

    The branch selection menu

  2. Using your favorite text editor, such as Atom, make the necessary changes to files in your project.

2. Selecting changes to include in a commit

As you make changes to files in your text editor and save them locally, you also see the changes in GitHub.

  • To add all changes in all files to a single commit, keep the checkbox at the top of the list selected.

    The checkbox for committing all changes

  • To add all changes in one or more files to a single commit, deselect the files you don't want included, leaving only the files you want in the commit.

    Checkboxes for committing some changes

  • To add all changes in all files to a single commit, keep the checkbox at the top of the list selected.

    The checkbox for committing all changes

  • To add all changes in one or more files to a single commit, deselect the files you don't want included, leaving only the files you want in the commit.

    Checkboxes for committing some changes

Creating a partial commit

If one file contains multiple changes, but you only want some of those changes to be included in a commit, you can create a partial commit. The rest of your changes will remain intact, so that you can make additional modifications and commits. This allows you to make separate, meaninful commits, such as keeping line break changes in a commit separate from code or prose changes.

When you review the diff of the file, the lines that will be included in the commit are highlighted in blue. To exclude the change, click the changed line so the blue disappears.

Selecting and deselecting lines in a file

Selecting and deselecting lines in a file

3. Write a commit message and sync your changes

Once you're satisfied with the changes you've chosen to include in your commit, write your commit message and sync your changes.

  1. At the bottom of the list of changes, in the Summary field, type a short, meaningful commit message. Optionally, you can add more information about the change in the Description field.

    Commit message field

  2. Under the Description field, click Commit to BRANCH.

    Commit button

  3. When you're ready to sync your commits with the remote repository, in the upper-right corner of the app, click Sync.

    The sync button

  1. At the bottom of the list of changes, in the Summary field, type a short, meaningful commit message. Optionally, you can add more information about the change in the Description field.

    Commit message field

  2. Under the Description field, click Commit to BRANCH.

    Commit button

  3. When you're ready to sync your commits with the remote repository, in the upper-right corner of the app, click Sync.

    The sync button

Tip: If you change your mind about a commit after you create it, you can revert the commit. For more information, see "Reverting a commit."