Learn Git & GitHub Basics in no time! (Windows users) — Part 1

zilhaz
5 min readNov 22, 2022

You have heard about Git and GitHub countless times and already know that they are used for version control. You got that, but you want to have a quick hands-on to see how they actually work. You are in the right place. It’s going to be a short but effective getting-started guide for you.

If you are unsure about the difference between Git and Github, watch this 10-minute Youtube video. Or you can simply keep following this guide, soon it will all be clear to you. We are going to perform the below tasks now. No worries if they don’t make total sense to you now. Hopefully, by the time you reach the end of this article, everything will fall into place for you!

  1. Create “website-project” repository in GitHub.com
  2. Create and commit index.html in the main branch of “website-project” repository.
  3. Install Git for Windows on your local Windows machine
  4. Create “Projects” folder on your local Windows machine
  5. Clone “website-project” repository from GitHub.com to “Projects” folder in your Windows machine.

Understanding the basics

Let’s say your team is going to start working on a new website development project. Often times you and your coworkers will need to work on the same document (for example, index.html) and make edits. All files in this project will be hosted on Github.com.

To kick off the development work, you will need to add a repository in GitHub. A repository or repo is like a folder on your PC. Whenever you hear repository or repo in GitHub, simply think of a folder on your PC. In this hands-on guide, soon we will create a repository and name it website_project.

You can open the index.html file in GitHub and start editing it. But it will be chaotic if two of your other colleagues also want to work on the same index.html at the same time. To avoid that, you want to copy the entire website_project repository to your local PC which will also include that index.html file. In Git terminologies, we would say “clone” the “website_project” repository.

Wondering how can you copy/clone from GitHub.com? Let’s go to the next section.

The setup: Installing Git on Windows and sign up for GitHub.com

By this time I am sure you figured that you need an account on GitHub.com. So, go ahead and open an account just like you sign up for an account on any website these days.

Let’s go back to our copy/clone from GitHub topic. We need to install Git on your Windows machine for that. Download Git for Windows and install it just like you install regular apps or programs on Windows. Once you are done with the installation, you should see three new apps on your PC — Git Bash, Git GUI and Git CMD.

Getting started with GitHub.com

As discussed earlier, you want to clone (copy) the “website-project” repository from GitHub.com to your Windows PC.

But have we even created our “website-project” repository yet? No. Let’s do that.

Login into GitHub.com and create a new repository called “website-project”. You can find the button for creating a new repository in multiple places. Click on any of them.

Name the new repository “website-project” and click the “Create repository” button.

Under Code tab you should see a link for creating a new file, click that.

Name the file “index.html” and type the below html code. Please note “in main” here. It means this index.html is in the “main” branch. We will discuss the concept of branch later. For now, go ahead and click “commit new file”. For now, think “commit” as saving a file in the repository. We will clarify it later.

Now under “Code” tab, you should see you have “main” branch and in that branch there is index.html file.

Clone the repository to your local machine

Create a folder in your local computer and name it “Projects”. Although you can use Git Bash or Git CMD from here. However, since Git is already installed now, you can also use Windows Powershell for simplicity. Go to the newly create folder, right click and click “Open in Terminal”.

To check if Git is installed correctly, type git –version in Windows Powershell. You should see the Git version number.

So far so good? Let’s clone the website-project repository from GitHub.com. Go to Code tab in your GitHub repository. On the right side click the dropdown under “<> Code” as you can see below. Copy the HTTPS URL.

Come back to Windows Powershell and type

git clone https://github.com/{your_user_name}/website-project.git

Don’t just copy-paste the above code, make sure after “git clone” you are pasting the HTTPS URL you just copied from GitHub.com.

Now if you look at your “Projects” folder, you will see your “website-project” repository got copied (cloned) to your local computer!

Congratulation if you reached this far! These are the steps you just completed -

  1. Create “website-project” repository in GitHub.com
  2. Create and commit index.html in the main branch of “website-project” repository.
  3. Install Git for Windows on your local Windows machine
  4. Create “Projects” folder in your local Windows machine
  5. Clone “website-project” repository from GitHub.com to “Projects” folder in your Windows machine.

— — — — — — — — —

Please click “Follow” if you want to learn more about Git and GitHub! See you in Part 2!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

zilhaz
zilhaz

Written by zilhaz

I am a cloud computing enthusiast and writer. Here, I share my insights on cloud computing, from beginner to advanced topics.

No responses yet

Write a response