← Back to list

Beginners Guide for Git & GitHub

When I was an intern, I used to spend a lot of time figuring things out. I asked too many silly questions and was always scared to use Git…

Nachatra Sharma · 2025-11-06 02:44 · 0 claps · 2.6 min read
#git #github #beginner #git-commands #basic-git-commands
Open on Medium ↗
Wiki topics: GEN · Genomics & Sequencing 🔓 · Open Source 🥊 · Combat Sports

Beginners Guide for Git & GitHub

When I was an intern, I used to spend a lot of time figuring things out. I asked too many silly questions and was always scared to use Git commands — I genuinely thought one wrong command could break the entire codebase 🥲. But then my senior guided me and taught me some basic Git commands. They might have seemed simple to him, but for me, they were a total game-changer. Now I can easily navigate through commits, and even handle rebasing and conflicts without fear.

The reason I’m sharing my story is because, just like me, there are many others who face the same struggles. Unfortunately, not everyone has someone to guide them through these things. That’s why I’ve decided to write a blog and share everything I’ve learned so far — so it can help others who are just starting their journey.

What is Git & GitHub ?

Git is a version control tool that helps you track and manage changes in your code or project. It allows you to work on different versions of your software, collaborate with others, and easily go back to previous versions when needed.

On the other hand, GitHub is a cloud-based platform that lets you store your Git repositories online. It provides a space where you can host your code, collaborate with teammates, and manage your projects using Git commands.

To download Git for your operating system, you can visit the official website using the link below 🔗

[embed]Install The entire Pro Git book written by Scott Chacon and Ben Straub is available to read online for free. Dead tree versions…git-scm.com

After downloading, you can verify that Git was installed correctly by checking its version. Open your terminal and run the following command:

git --version

Areas in Git

  • working area There can be a bunch of files which are currently not tracked by git. Means, if we make any changes to those files git will not gonna track those changes. When we do git status and we see a bunch of untracked file which actually consider to be in working area.
  • staging area What all files are going to be the part of the next version that we will create. In this staging area git tracks what all changes we have done from prev version to the current version.
  • repository area This area actually contains all the details of the prev version. And files of this area git is already track them and there version, history of the changes.

Basic Git Commands

  1. git init It will initialise git in your current working directory. Also this command gonna create a hidden folder name as .git in your current working dir.
  2. git status It helps you see which files have been modified, staged, or are untracked by Git.
  3. git add <file_name> move file from working area to staging area.
  4. git restore --staged <file_name> move file back from staging are to working area.
  5. git commit is used to save your staged changes as a new version in the repository. In simple terms, it take a snapshot of all the file you’ve added to the staging area and creates a new version of your project.
  6. git log list down all the previous commit of the repository. If you want to exit out of the git log prompt press ‘q’.
  7. git remote list down all the remote connection names.
  8. `git remote add <name_of_the_remote_connection> <link_of_the_remote_connection>`` this command help us to add a new link to the remote repository and give a name to it.
  9. git push <name_of_the_remote_connection> <branch_name> it will push all the commits which are pending to move to the remote repository.

I hope this post helped you understand the basics of Git and GitHub. I’ll be sharing more practical guides and concepts in the next blogs — stay connected! ✌️


메타데이터
post_id
2063b72df2f5
slug
beginners-guide-for-git-github-2063b72df2f5
url
https://medium.com/@sharmanachatra/beginners-guide-for-git-github-2063b72df2f5
canonical_url
https://medium.com/@sharmanachatra/beginners-guide-for-git-github-2063b72df2f5
author_url
https://medium.com/@sharmanachatra
status
ok
fetched_at
2026-08-30 07:29:05