Member-only story

10 Must-Know Git Commands That Will Save You Hours

3 min readFeb 15, 2025
Photo by Roman Synkevych on Unsplash

Git is an essential tool for developers, but without a solid grasp of its core commands, you can easily find yourself stuck, wasting precious time. Whether you’re just starting with Git or looking to refine your workflow, mastering these ten commands will boost your efficiency and save you hours of troubleshooting.

1. git init – Initialize a New Repository

When starting a new project, you need to set up a Git repository. The git init command creates a new repository in your project directory.

Usage:

git init

This command initializes a new Git repository (basically create a .git file) in your current directory, allowing you to start tracking changes. If you’re cloning an existing repo, you don’t need to run this command.

2. git clone – Copy an Existing Repository

If you want to work on an existing project, you can clone the repository using git clone.

Usage:

git clone <repository-url>

Example:

git clone https://github.com/django/django.git

This command creates a local copy of the repository on your machine, including all…

--

--

Aashish Kumar
Aashish Kumar

Written by Aashish Kumar

Hi, I’m Aashish Kumar, a passionate software engineer from India 🇮🇳, specialize in Python | Django | AI | LLM | Full Stack Development.

No responses yet