Skip to content

GitHub Cheat Sheet: GitHub Commands और GitHub की Complete Hinglish Guide

Updated 5 Oct 2026 4 min scan

GitHub क्या है?#

GitHub एक online platform है जहाँ developers अपने Git repositories को host, manage और collaborate कर सकते हैं।

Simple words mein:

Git आपके computer पर code की history manage करता है, जबकि GitHub आपके Git projects को online store और collaborate करने में मदद करता है।

Example:

Code
Your Computer
     ↓
    Git
     ↓
GitHub Repository
     ↓
Team / Collaboration

GitHub पर आप:

  • Code host कर सकते हैं
  • Projects share कर सकते हैं
  • Team के साथ collaborate कर सकते हैं
  • Issues create कर सकते हैं
  • Pull Requests बना सकते हैं
  • Code review कर सकते हैं
  • Open-source projects में contribute कर सकते हैं
  • Project documentation maintain कर सकते हैं

Git और GitHub में क्या Difference है?#

यह सबसे important concepts में से एक है।

GitGitHub
Version Control SystemOnline development platform
Local machine पर चलता हैInternet-based platform
Changes track करता हैRepository host करता है
Commit करता हैPull Request / Issues जैसी collaboration सुविधाएँ देता है
Branch manage करता हैTeam collaboration में मदद करता है

एक simple example:

Code
Git = Version Control Tool
GitHub = Git Repository Hosting + Collaboration Platform

GitHub Git का replacement नहीं है।


GitHub Repository क्या है?#

Repository या short में repo, एक project का online home होता है।

Example:

Code
my-project
├── README.md
├── src/
├── package.json
├── .gitignore
└── ...

Repository में project का:

  • Source code
  • Git history
  • README
  • Branches
  • Issues
  • Pull Requests
  • Other project files

हो सकते हैं।


GitHub Account और Repository#

GitHub पर काम करने के लिए पहले account बनाना होता है।

फिर आप:

Code
GitHub Account
      ↓
Repository
      ↓
Project Code

बना सकते हैं।

एक account में multiple repositories हो सकती हैं।

Example:

Code
account/
├── portfolio
├── ecommerce-app
├── weather-app
└── learning-project

GitHub Repository कैसे बनाएं?#

GitHub पर नया repository create करते समय सामान्यतः आपको:

  • Repository name
  • Description
  • Public/Private visibility
  • README
  • .gitignore
  • License

जैसी options मिल सकती हैं।

Example repository name:

Code
my-react-app

Project के purpose के अनुसार clear repository name रखना useful है।


Public और Private Repository#

GitHub repository की visibility important है।

Public Repository

Public repository को दूसरे लोग देख सकते हैं।

यह open-source projects और public portfolio के लिए useful हो सकती है।

Private Repository

Private repository का access restricted होता है।

इसका use:

  • Private projects
  • Company code
  • Personal projects
  • Internal development

के लिए किया जा सकता है।


GitHub README क्या है?#

README.md repository का introduction/documentation page होता है।

एक अच्छे README में हो सकता है:

Code
Project Name
Description
Features
Installation
Usage
Screenshots
Configuration
Contributing
License

Example:

Code
# My Project

A simple web application.

## Features

- User authentication
- Dashboard
- API integration

## Installation

npm install

README project को समझने में नए developer की मदद करता है।


Local Project को GitHub पर Push करना#

मान लीजिए आपके computer पर project है:

Code
my-project/

सबसे पहले:

Code
cd my-project

Git initialize करें:

Code
git init

Files check करें:

Code
git status

Files add करें:

Code
git add .

Commit करें:

Code
git commit -m "Initial commit"

अब GitHub पर repository create करें।

फिर remote add करें:

Code
git remote add origin <repository-url>

Remote check करें:

Code
git remote -v

Main branch set कर सकते हैं:

Code
git branch -M main

फिर push:

Code
git push -u origin main

Basic flow:

Code
Local Project
     ↓
git init
     ↓
git add
     ↓
git commit
     ↓
git remote add
     ↓
git push
     ↓
GitHub

GitHub Repository Clone करना#

अगर repository पहले से GitHub पर है और आपको अपने computer पर उसकी copy चाहिए:

Code
git clone <repository-url>

Example:

Code
git clone https://github.com/user/project.git

फिर:

Code
cd project

अब आप local project पर काम कर सकते हैं।


GitHub से Latest Changes लेना#

Team project में दूसरे developers changes push कर सकते हैं।

Latest changes लेने के लिए:

Code
git pull

Example:

Code
git pull origin main

Simple flow:

Code
GitHub
  ↓
git pull
  ↓
Local Project

GitHub पर Code Push करना#

Local changes commit करने के बाद:

Code
git push

Specific branch:

Code
git push origin feature-login

पहली बार:

Code
git push -u origin feature-login

इसके बाद:

Code
git push

काम कर सकता है।


GitHub Branch क्या है?#

Branch project की अलग development line होती है।

Example:

Code
main
 │
 ├── feature-login
 ├── feature-payment
 └── bugfix-navbar

Team development में अलग feature के लिए branch बनाई जा सकती है।

Example:

Code
git switch -c feature-login

फिर code लिखें और commit करें।


Main Branch#

main आमतौर पर repository की primary branch होती है।

Example:

Code
main

लेकिन अलग projects अपनी branching strategy के अनुसार अलग naming या workflow use कर सकते हैं।

Important बात यह है कि branch का नाम project/team workflow पर depend कर सकता है।


GitHub Branch Push करना#

नई branch:

Code
git switch -c feature-login

Changes:

Code
git add .
git commit -m "Add login feature"

Push:

Code
git push -u origin feature-login

अब branch GitHub repository में भी available हो सकती है।


Pull Request क्या है?#

Pull Request (PR) GitHub का important collaboration feature है।

जब आप किसी branch में changes करते हैं और उन्हें दूसरे branch में merge करवाना चाहते हैं, तो Pull Request बनाया जा सकता है।

Example:

Code
feature-login
      ↓
 Pull Request
      ↓
main

PR में team members:

  • Changes review कर सकते हैं
  • Comments कर सकते हैं
  • Code discuss कर सकते हैं
  • Required changes मांग सकते हैं
  • Approve कर सकते हैं
  • Merge कर सकते हैं

Pull Request का Practical Workflow#

मान लीजिए आपको login feature बनाना है।

Step 1 — Branch बनाएं

Code
git switch -c feature-login

Step 2 — Code करें

Code
login.js
login.css
login.html

Step 3 — Commit करें

Code
git add .
git commit -m "Add login feature"

Step 4 — GitHub पर Push करें

Code
git push -u origin feature-login

Step 5 — Pull Request बनाएं

GitHub पर:

Code
feature-login
      ↓
Pull Request
      ↓
main

Step 6 — Review

Team changes review करती है।

Step 7 — Merge

Approved होने के बाद PR merge किया जा सकता है।


Fork क्या है?#

Fork किसी दूसरे GitHub repository की अपने GitHub account में copy बनाने का तरीका है।

यह open-source contribution में commonly useful होता है।

Example:

Code
Original Repository
        ↓
       Fork
        ↓
Your GitHub Account
        ↓
Your Changes

Fork और clone same चीज़ नहीं हैं।

Fork

GitHub पर repository की copy बनाता है।

Clone

Repository को local computer पर copy करता है।


Fork और Clone का Difference#

ForkClone
GitHub account में repository copyLocal computer में repository copy
GitHub पर होता हैComputer पर होता है
Open-source contribution में usefulLocal development में useful
Original repo से अलग remote हो सकता हैLocal Git repository बनती है

Open Source Contribution Workflow#

एक common open-source workflow:

Code
Original Repository
        ↓
      Fork
        ↓
    Your GitHub
        ↓
      Clone
        ↓
 Create Branch
        ↓
      Code
        ↓
     Commit
        ↓
      Push
        ↓
 Pull Request
        ↓
Original Repository

यही workflow समझना GitHub सीखने का important part है।


GitHub Issues क्या हैं?#

Issues repository में bugs, tasks, improvements और discussions track करने के लिए use किए जा सकते हैं।

Example:

Code
Issue #24
Fix mobile navigation

Issue में:

  • Description
  • Labels
  • Assignees
  • Comments
  • Status

जैसी information हो सकती है।

Example issues:

Code
Bug: Login button not working
Feature: Add dark mode
Task: Update documentation

GitHub Labels#

Issues और Pull Requests को categorize करने के लिए labels useful हैं।

Example:

Code
bug
feature
documentation
enhancement
help wanted
good first issue

इससे project management आसान हो सकता है।


GitHub Code Review#

Pull Request के दौरान developers code review कर सकते हैं।

Reviewer:

Code
Review Code
     ↓
Comment
     ↓
Request Changes / Approve

Code review का purpose सिर्फ mistakes ढूँढना नहीं है।

यह:

  • Code quality
  • Maintainability
  • Security
  • Bugs
  • Project conventions

जैसी चीजों को check करने में भी मदद कर सकता है।


GitHub Actions क्या है?#

GitHub Actions repository में automated workflows run करने के लिए use किया जा सकता है।

Example:

Code
Push Code
    ↓
GitHub Actions
    ↓
Run Tests
    ↓
Build
    ↓
Deploy

इस तरह repetitive development tasks automate किए जा सकते हैं।

Example use cases:

  • Tests run करना
  • Build करना
  • Linting
  • Deployment
  • Scheduled workflows

GitHub Releases#

जब project का कोई important version release होता है, तो GitHub Releases का use किया जा सकता है।

Example:

Code
v1.0.0
v1.1.0
v2.0.0

Tags और releases project versions को organize करने में useful हो सकते हैं।


GitHub .gitignore#

.gitignore उन files/folders को specify करता है जिन्हें Git track नहीं करे।

Example:

Code
node_modules/
.env
dist/
*.log

Node.js project में:

Code
node_modules/

को generally repository में commit नहीं किया जाता।

Sensitive configuration:

Code
.env

को भी carefully handle करना चाहिए।


GitHub पर Secrets क्यों Important हैं?#

कभी भी source code में directly sensitive information डालने से बचें।

Example:

Code
const API_KEY = "secret-key";

इसके बजाय environment variables और appropriate secret-management mechanisms use करें।

गलती से secret repository में push हो जाए तो सिर्फ file delete करना हमेशा sufficient नहीं होता; secret को rotate/revoke करना भी आवश्यक हो सकता है।


GitHub Profile को Developer Portfolio की तरह Use करना#

GitHub profile आपके development work को showcase कर सकती है।

Useful चीजें:

  • Good README
  • Useful repositories
  • Clear project descriptions
  • Meaningful commit history
  • Documentation
  • Open-source contributions

Repository का नाम और README ऐसा रखें कि कोई developer project को जल्दी समझ सके।


GitHub Repository Naming Tips#

Bad:

Code
test
project123
newproject
abc

Better:

Code
react-task-manager
php-invoice-system
wordpress-epaper-manager
weather-dashboard

नाम देखकर project का purpose समझ आना चाहिए।


GitHub README में क्या लिखें?#

एक practical README structure:

Code
# Project Name

Short description

## Features

- Feature 1
- Feature 2
- Feature 3

## Tech Stack

- React
- Node.js
- MySQL

## Installation

npm install

## Usage

npm run dev

## Screenshots

...

## Contributing

...

## License

...

Project की जरूरत के हिसाब से sections add/remove किए जा सकते हैं।


GitHub के साथ Daily Developer Workflow#

एक common workflow:

Code
git pull

नई branch:

Code
git switch -c feature-name

Code करें।

फिर:

Code
git status

Changes stage करें:

Code
git add .

Commit:

Code
git commit -m "Add new feature"

Push:

Code
git push -u origin feature-name

फिर GitHub पर Pull Request बनाया जा सकता है।


Common GitHub Mistakes#

1. .env GitHub पर push करना

Sensitive data accidentally public हो सकता है।

Use:

Code
.gitignore

और secrets को safely manage करें।

2. Directly main पर changes करना

Team projects में feature branch workflow useful हो सकता है।

Code
git switch -c feature-name

3. Pull किए बिना काम शुरू करना

Team project में local branch पुरानी हो सकती है।

Code
git pull

project workflow के अनुसार useful हो सकता है।

4. Meaningless commit messages

Avoid:

Code
git commit -m "update"

Better:

Code
git commit -m "Fix checkout validation"

5. README खाली छोड़ना

एक अच्छा README project को समझने में काफी मदद करता है।

6. Large/generated files commit करना

Build output, dependencies और unnecessary generated files को project-specific .gitignore में handle करें।


GitHub और Git को साथ में कैसे याद रखें?#

एक simple mental model:

Code
Git
 ↓
Local Version Control
 ↓
Commit
 ↓
GitHub
 ↓
Remote Repository
 ↓
Push / Pull
 ↓
Team Collaboration

Feature workflow:

Code
GitHub
  ↓
Clone / Pull
  ↓
Branch
  ↓
Code
  ↓
Commit
  ↓
Push
  ↓
Pull Request
  ↓
Review
  ↓
Merge

GitHub Commands Quick Reference#

कामCommand
Repository clonegit clone <url>
Repository initializegit init
Statusgit status
Add filegit add <file>
Add allgit add .
Commitgit commit -m "message"
Remote checkgit remote -v
Remote addgit remote add origin <url>
Pushgit push
First branch pushgit push -u origin <branch>
Pullgit pull
Fetchgit fetch
Branch listgit branch
Create branchgit branch <name>
Create + switchgit switch -c <name>
Switch branchgit switch <name>
Mergegit merge <branch>
Loggit log --oneline
Stashgit stash
Stash restoregit stash pop

GitHub Workflow Cheat Sheet#

New GitHub Project

Code
git init
git add .
git commit -m "Initial commit"
git remote add origin <url>
git branch -M main
git push -u origin main

Existing GitHub Project

Code
git clone <url>
cd project
git pull

New Feature

Code
git switch -c feature-name
git add .
git commit -m "Add feature"
git push -u origin feature-name

फिर:

Code
Create Pull Request
        ↓
Review
        ↓
Merge

Knowledge Check#

Q1. GitHub क्या है?

A. Programming Language
B. Online development and repository platform
C. Database
D. Operating System

Answer: B

Q2. Repository को local computer पर लाने के लिए?

A. git download
B. git clone
C. git copy
D. git pull-project

Answer: B

Q3. Local commits को GitHub पर भेजने के लिए?

A. git pull
B. git fetch
C. git push
D. git send

Answer: C

Q4. Pull Request का purpose क्या है?

A. Computer बंद करना
B. Code changes को review और merge workflow में लाना
C. Git install करना
D. Repository delete करना

Answer: B

Q5. Fork क्या करता है?

A. Repository को delete करता है
B. GitHub account में repository की copy बनाता है
C. Local files remove करता है
D. Commit revert करता है

Answer: B


Practical Exercises#

Exercise 1 — GitHub Repository बनाएं

एक नया repository बनाएं:

Code
github-practice

फिर local project initialize करके GitHub पर push करें।


Exercise 2 — Branch बनाएं

Code
git switch -c feature-test

एक छोटा change करें:

Code
git add .
git commit -m "Add feature test"
git push -u origin feature-test

फिर GitHub पर branch देखें।


Exercise 3 — Pull Request बनाएं

अपनी feature branch से:

Code
feature-test
      ↓
Pull Request
      ↓
main

PR create करें और changes review करें।


Exercise 4 — README बनाएं

अपने project में:

Code
README.md

बनाकर ये sections add करें:

Code
Project Name
Description
Features
Tech Stack
Installation
Usage

Exercise 5 — .gitignore Practice

एक .gitignore file बनाएं और project के unnecessary files/folders add करें।

Example:

Code
node_modules/
.env
dist/

फिर:

Code
git status

से verify करें।


Summary#

आसान भाषा में:

Git local version control है और GitHub Git repositories को online host और collaborate करने का platform है।

GitHub के सबसे important concepts:

Code
Repository
Branch
Commit
Push
Pull
Fork
Pull Request
Issues
Code Review
GitHub Actions
README
.gitignore

सबसे important workflow:

Code
Clone / Pull
     ↓
Create Branch
     ↓
Write Code
     ↓
Commit
     ↓
Push
     ↓
Pull Request
     ↓
Review
     ↓
Merge

Git सीखने के बाद GitHub सीखने का main goal commands याद करना नहीं है, बल्कि remote repository और collaborative development workflow समझना है।