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.
- 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.
- Click on New branch when you have entered the name.
You can also publish the branch to origin by clicking the Publish branch button.
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.
- 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).
- 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.
- Then hit the commit button.