Skip to content
Subin Thapa

Subin Thapa

  • Home
  • About
  • Service
  • Portfolio
  • Blog
  • Contact
Schedule Meeting

Git Cheatsheet for Beginners

subinthapaJune 20, 2025September 13, 2025 No Comments

Git

It is a version control system, which is a tool used to manage changes to code, programs, documents and other information stored as computer files.

GitHub

It is a hosting platform that allows developers to create, store, and manage their code. On Github you can upload your code to a public or private space on the internet.

Git Cheatsheet

Here are some of the most common commands you’ll need to know:

For Config

git config --global user.name "Your Name"
git config --global user.email "youremail@domain.com"

bash

To View Username, Email and Other Details

git config --list

bash

To Get Help

git help

bash

Initialize a Repository

git init

bash

To Add File or Files To Staging Area

git add filename
git add .

bash

To Commit Change

git commit -m 'Short and Sweet Message' 

bash

Clone Existing Repository

git clone <project_url>

bash

Checking the Status Files

git status

bash

View Difference

git diff

bash

To Remove File From git

 git rm filename

bash

To Move File

 git mv file_from file_to

bash

To View Commit History

git log

bash

To Work With Remote Repository

git remote show origin
git remote -v
git remote add origin
git push origin 
git pull

bash

To Create Branch

git branch 

bash

To Switch Branch

git checkout 

bash

To Merge Branch

git merge 

bash

To Delete Branch

git branch -d 

bash

To Create Tag

git tag 

bash

To Push Tag

git push origin 

bash

To Delete Tag

git tag -d 

bash

To Push All Tags

git push origin --tags

bash

To Delete Remote Tag

git push origin :refs/tags/<tagname>

Quick Start Example

Here’s how you can push your first project to GitHub:

git init
git remote add origin https://github.com/kaushen078/your-repo-name.git
git add .
git commit -m "Initial commit with all files"
git branch -M main
git push -u origin main

Post navigation

Previous: Top 5 Myths in Artificial Intelligence (A.I.)
Next: How to Upload Your First Project to GitHub Using GitHub Desktop (For Beginners)

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2025 Subin Thapa
No Form Selected This form is powered by: Sticky Floating Forms Lite