GitHub Is Essential for Learning to Code — A Beginner's Guide to GitHub Desktop
Bottom Line First
You can use GitHub without knowing the terminal. Install GitHub Desktop, create a repository, make a commit, and click push. That is it. There are just three core concepts: repository, commit, and push.
Step 0. Put Just Three Concepts in Your Head
Before you start, understanding these three cuts the complexity in half.
| Concept | Description |
|---|---|
| Repository | Your project folder on your computer, recreated in GitHub's space — your code storage box |
| Commit | Taking a snapshot of your code's current state and pressing save |
| Push | Uploading the commits saved on your computer to the GitHub server |
A commit saves to your computer; a push uploads to the internet. That distinction is everything.
Step 1. Install the Prerequisites and Sign In
First, create an account on GitHub's official site. Then download and install the program from the GitHub Desktop download page. For beginners, the desktop app is safer than the command-line way.
After launching the program, click Sign in to GitHub.com and log in with the account you just created. That is all the preparation.
Step 2. Create Your Code Storage Box
First, make a room to put your code on the internet. We will proceed with the safest and easiest method: creating the room on your computer and uploading it.
- From the top menu of GitHub Desktop, click File, New Repository.
- Enter the following in the popup.
| Field | Value |
|---|---|
| Name | Your project name (e.g., my-first-coding) |
| Local Path | Where the folder is saved on your computer (the default is fine) |
| Initialize this repository with a README | Check it (creates a project description file automatically) |
- Click the Create Repository button at the bottom.
- A Publish repository button appears in the center of the screen. Click it to create the room on the GitHub server.
Step 3. Write Code and Save It (Commit)
Now just study coding as usual. Inside the folder you just created, write and save anything — a text file, HTML, a Python file. For example, create a file called hello.txt, write "Hello," and save it.
Save your code and return to GitHub Desktop. On the left side of the screen, the names of the files you just created or changed are automatically detected and listed.
In the Summary box at the bottom left, leave a note about what code you wrote this time. For example, write "First code." Then click the Commit to main button below it.
One important point: up to here, the save (Commit) to your computer is complete. It has not yet been uploaded to the GitHub website.
Step 4. Final Upload to the Internet (Push)
It is time to upload the record saved on your computer to GitHub. Once you complete the commit, a Push origin button newly appears at the very top of the program. Click this button.
A gauge fills for a few seconds as the upload proceeds. When it finishes, go to the repository on your GitHub profile in a browser, and the code you wrote on your computer is there.
The Fail-Proof Order
| Order | Action | Location |
|---|---|---|
| 1 | Create a GitHub account | Browser |
| 2 | Install GitHub Desktop and sign in | Your computer |
| 3 | New Repository and Publish | Desktop app |
| 4 | Write code, then Commit | Desktop app (saves to your computer) |
| 5 | Push origin | Desktop app (uploads to the internet) |
At first, practice with a Private repository instead of Public. If you make a habit of writing a one-line commit message about what you did that day, your study record later becomes a portfolio in itself.
Appendix. Doing It with Terminal Commands
Once you are comfortable with the desktop app, learn the terminal commands too. They do exactly the same work. This is written for Linux.
Check git installation and first-time setup
git --version
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch main
The name and email are the stamp printed on your commits. You set them only once.
Clone a repository (Clone)
Bring your repository on GitHub down to your computer.
git clone https://github.com/your-id/my-first-coding.git
cd my-first-coding
Check the status (Status)
See which files have changed right now. It is the command you type most often.
git status
Files shown in red are modified or newly created.
Save (Add + Commit)
Bundle the changed files into a snapshot. Two steps.
git add hello.txt
git commit -m "First code"
If there are several files, stage them all at once with git add .. The text in quotes after -m is the commit message.
Upload (Push)
Upload the commits on your computer to GitHub.
git push origin main
Download (Pull)
Bring changes uploaded elsewhere down to your computer. Essential when you study while moving between home and school.
git pull origin main
View the log (Log)
See the list of commits you have made so far. It is your study journal.
git log --oneline
App-to-command cheat sheet
| What you did in the desktop app | Terminal command |
|---|---|
| Publish repository | Create the repo on GitHub, then git clone |
| Check changed files | git status |
| Commit to main | git add . then git commit -m "message" |
| Push origin | git push origin main |
| View log | git log --oneline |
The order is the same whether app or terminal: check status, stage (add), commit, push. Memorize just these four beats.
AI Knowledge Hub