Add Local Commits With GitHub Desktop


After you have finished making your changes, it is time to commit them.

gif of following the directions below

  1. Click the changes tab in the left sidebar to see a list of the files that have been changed or added since the last commit.
  2. Use the checkboxes to indicate which files should be part of the commit. In this activity, you’ll select the index.html file.

    Note: It is a good idea to group files together based on the type of changes or the file content. For example, if you fixed the same formatting issue in several documents, you should group them into one commit.

  3. Type your commit message in the Summary field.
  4. You will notice that GitHub Desktop has already populated the commit button with the current branch. Simply click the button to commit your changes.
Tell me why

Making great commits

When you work on, a commit can only include the changes you made to a single file. But, when you work in the desktop app, you have a lot more control over your commits.

With GitHub Desktop, a commit can include multiple files, or you can pick a specific change within a file you would like to commit.

When you assemble the changes you have made, you should try to create what we like to call an atomic commit. In other words, each commit you make should contain changes that belong together and represent a discrete unit of work.

Stuck? Open an issue in the repository for this class and mention @githubteacher for help from one of the GitHub trainers!