Github Desktop – Step 3 – Branch, Edit, Commit

GitHub Branch Edit Commit

Branches, Edits & Commits

This article is part of a series on Github Desktop. For the introductory piece you can visit here.

Now, it’s time to get to work and start making your changes to the file(s). You should do this in a branch; this keeps your workspaces separate and manageable. Once you have created a branch, make quite sure GitHub Desktop is showing it as your current active branch, then go in and start work. You can commit these as you go at any time. GitHub will keep track of everything and it’s easy to roll back to a previous commit. Your local files will now be out of sync with origin and upstream.

So, to get started click the arrow button to open the “branches” dropdown list.

GitHub Desktop switch branch

  1. Type in the name of a new branch. Make the name descriptive of the job you will be doing and try to keep to one branch for one job. In the early stages it’s a good idea to keep the scope of the jobs small. In this example we are adding an FAQ section to the readme file.
  2. Click on New branch when you have entered the name.

GitHub Desktop New Branch

You can also publish the branch to origin by clicking the Publish branch button.

GitHub Desktop Publish Branch

Make extra sure that your new branch is shown as Current branch in the top bar. Then go into your cloned files and start making your changes. You can commit the changes whenever you like. You might choose to work in stages and commit after each stage, or you might do the whole job in one go and commit at the end.

  1. When you come back to GitHub Desktop it will show you the list of files that have been changed, and give you an indication of all the changes (green background for additions, red background for removals).
  2. For each commit you should enter a short description about the work that has been done. This will help you if you need to roll back to a previous commit.
  3. Then hit the commit button.

GitHub Desktop edit and commit

 

Avatar for Alan Coggins
About Alan Coggins

Alan builds and maintains websites. He thinks that computing is way too complicated for most people and enjoys finding simple and elegant ways to make things happen. His clients seem to appreciate this approach.