This blog post covers the most common and basic git operations that be done using GitHub Desktop. It can be used with other Git hosting services such, but the focus will be on GitHub in this post.
What is GitHub Desktop?
Github Desktop is a free and open-source software that provides a graphical user interface to use git instead of using the prompts. It means you don’t need to learn how to use the command lines to have a proper usage of Git.
Features
It allows you to:
Clone a repository to your local environment
Rebase your current branch
Write commit messages and push branches to your distant repository
Open a pull request
And a lot more.
This blog post focuses on the actions described above and do not cover specificities such as code review.
Installation and setup
Download
GitHub Desktop is available for Windows and Mac and can be download from this link.
GitHub Desktop is not officially available on Linux. Still, a fork version can be installed.
Associate GitHub Account
By opening the File > Options...
menu, you will be able to connect your GitHub account directly.
Clone a repository
A repository hosted on GitHub can be cloned in two clicks. From the repository page, click on Code and then Open with GitHub Desktop.
Start coding
The top screen menu allows you to:
Select the repository you want to work on
Select the branch you want to work on
Retrieve the latest changes from the remote repository without applying them to your working directory using Fetch origin
When your branch is selected you can run the coding software of your choice and that coding.
The list of supported editors is available here.
Commit changes, push branches and pull request
Once you’re ready with an addition or modification of a program, the update history is automatically displayed in GitHub Desktop.
In the bottom left corner of the GitHub Desktop window, you can write a clear can concise commit message that will describe your modifications and status. The “Description” field can be used to add more information.
Once the commit is done, you can push your branch from your local folder to the remote repository.
Then the remote repository will be updated.
Finally, when you are ready to open a pull request directly from GitHub Desktop.
The GitHub webpage will open in the pull request creation webpage.
The code review can be done directly form GitHub or from GitHub Desktop.