GitHub Desktop Tutorial — A GUI Client for GitHub (Software Version Control System) — Part 01
GitHub Desktop is one of the GUI clients that are available to interact with GitHub without typing the commands. It is a widely used and vastly preferred platform in the software industry which actually improves the team collaboration of the project. Most of the tasks that you wish to do with GitHub can be easily performed with visual confirmation in GitHub Desktop.
Now let’s see how to get started with GitHub Desktop and how we can collaborate and contribute to the Git projects using it.
Installation and Authentication
You can easily download the GitHub Desktop application setup file from its official page where you can choose the setup file for the preferred operating system. The file will be typically downloaded and saved into the “Downloads” folder of your machine. Double tap the setup file to start the installation of GitHub Desktop application.
Once the installation process is complete, you can authenticate your application with your GitHub account. This allows you to connect to the remote repositories on GitHub.
In order to authenticate your application, first you need to have an account on GitHub. If you don’t have an account, you can go to the signup page and create an account.
After completing the signup process, now you are all set to authenticate your account with the GitHub Desktop application. Let’s see how we can do this authentication with the GitHub Desktop.
First, open GitHub Desktop application and click the “File” tab.
In the File drop-down menu, click “options” which will prompt a window.
In that options window, you have to select Accounts.
On the right side of the window, you will see a “Sign in” option. Click it.
In the “Sign in Using Your Browser” pane, you have to click the “Continue With Browser” option. GitHub Desktop will open the sign in page with your default browser.
Now provide your GitHub credentials (username and password) to sign in.
After the authentication of your account, follow the prompts to return to GitHub Desktop application.
Configuration and Customization
Once you complete the installation and authentication, you can configure and customize your GitHub Desktop application now. For that, again go to the “File” tab and select the options. In the prompted window you can navigate into different options and change the default settings according to your preferences.
The choices listed in the Options window are used for several separate tasks such as follows:
- Accounts → add or remove GitHub account
- Integrations → select external editor and shell
- Git → edit Git configurations
- Appearance → select theme for the application
- Prompts → enable or disable confirmation dialogs before destructive actions
- Advanced → more configuration options
You can choose the configurations according to your need and preference and customize the application as per your wish.
Alright, now we are done with all the initiation processes of the GitHub Desktop application and hereafter, the application is completely ready to be used for the real project purposes.
Creating a Repository with GitHub Desktop
It is really easy to create repositories with the GitHub Desktop application rather than using command line.
Now as we are freshly starting with the GitHub Desktop application, you can see the “Let’s get started!” view on your application now.
Now let us see briefly the options that are mentioned in the very first view of the application and what we can do with those options.
Create a tutorial repository…
You can use this option to create and practice with a new repository. The repository created with this option will be private to your account only and not visible to others. You can only use that repository to practice and learn.
Clone a repository from the internet…
This option can be used to clone the remote repositories that are available online into your local machine.
Here you have to sign in to get your repositories cloned or else you can provide the URL of the repository to clone it.
Create a New repository on your hard drive…
Using this option you can create a new repository by providing the necessary details.
Name → name for your repository
Get Priyanthini Sivasubramaniyam’s stories in your inbox
Join Medium for free to get updates from this writer.
Description → useful information about the purpose of your repository (optional)
Local path → location of your repository on your local machine/ the destination where you want to save this repository in your local machine
Initialize this repository with a README → when we check this checkbox, it creates an initial commit with a README.md file. README.md file is an important file in which you can add helpful information about your repository.
The Git ignore drop-down menu lets you add a custom file to ignore specific files in your local repository that you don’t want to store in version control.
The License drop-down menu lets you add an open-source license to a LICENSE file in your repository.
If you are just starting to work with GitHub Desktop, please don’t worry about git ignore and license options. Just keep them as the default ones.
Add an existing Repository from your hard drive…
You can select the path of the repository (directory on your local machine) that you want to add from your local machine.
Now as we’re freshly starting to use GitHub Desktop, let’s select the second option “Create a New Repository on your hard drive”. Then fill in the necessary information and create a new repository.
Once the new repository is created, open it with the File Explorer(this option can be seen on the application’s initial view after creating a repository). There select, open and edit the README.md file and save it. Now let’s switch to the GitHub Desktop application and check what happened there.
Now if you switch to the GitHub Desktop after editing and saving the file in your repository, you can see a view like this.
Here you can now see how this application is showing us the modifications clearly. The code areas that we have changed are highlighted. And since we have added something to the file it shows the modification with a + sign.
In version controlling, ‘regular commits’ are always a best practice. The changes you made can be small, but make sure to commit each of the change regularly.
Commits
Now let us see how we can commit the changes that we made to the README.md file of our newly created repository.
In order to commit the changes that we made, we need to write a relevant commit message on the bottom left corner of the screen. Since we have updated the README.md file, let’s provide the commit message as “README.md update” and click “commit to main” (here main is the default branch, so it refers to the commit to that default main branch. If you change the current branch then it will show you the option as commit to the new branch that you selected).
Once committed, the application will show a message as “committed just now” with the commit message that you provided, so that you can confirm that the commit process is completed.
Publish Repository and Push Origin
Up to now, whatever we have done is committed and saved only in the local repository that resides on our local machine. But we need to keep our repository online rather than just keeping it on our machine. For that, you have to select the “Publish repository” option.
Once you click that option, it will ask you to sign in to your account. Once the sign in is completed, it will redirect you to your GitHub Desktop application. Now click the “Publish repository” option that is prompted again.
Confirm the auto filled details (if you need any modifications you can do them now) and publish the repository.
Note : “Keep this code private” option makes your code invisible to the public. If you do not select this option, other users on GitHub can view your code.
Now go to your GitHub profile using a browser and you can find the newly created repository there.
After publishing the repository, whenever you make a commit on your local repository you must click the “Push origin” button to see those changes on your GitHub remote repository.
For example: Let’s add a new file into our local repository with some description on it and commit. Now check your GitHub page on your browser whether that new file is updated there or not. The answer is Definitely No!
You have to click “push origin” in this case. After pushing, check your GitHub page. Now you can see the newly added file with the content you updated in your remote repository too.
Fetch Origin and Pull Origin
After pushing the commits to the original remote repository, now you can see another option called “Fetch origin” there. What’s that?
Let’s see what is “Fetch origin” now.
Once you make some changes in your local repository, you’re pushing them to the remote repository. In the same manner, other collaborators of your project will also push their changes to that remote repository. But the changes pushed by other collaborators will only be seen on the remote GitHub repository. Now if you need to get those changes that are implied by others, you need to get or fetch them from the remote GitHub repository. For that purpose we can use this “Fetch origin” option.
For example, I will do it myself here. Using the GitHub page in the browser I am going to edit one of the file. You also do it in the same way. Now check your GitHub Desktop whether you got those changes (you made on the remote repository) or not.
No right?
Now click that “Fetch origin” option on your GitHub Desktop application and see what happens. You will see a message as follows:
It will ask you whether you want to get those changes to your local repository. So click on the “Pull origin” button to get those changes in to your local repository.
Now click the “history” button next to the changes button on GitHub Desktop to see the previous versions of the repository along with the changes made on each version.
The “changes” section shows you the changes that you have made and not committed to your local repository yet.
Up To now, together we have created a new repository ourselves and checked how to make changes in the repository and commit them to the remote repository on GitHub. Also we have seen how to fetch the changes made by other collaborators on the remote repository to our local repository on our own machine.
In the next part of this article series let us see how to clone a repository, how to fork a repository and some more interesting things about using GitHub Desktop application.







