Skip to content

Git Setup

Installation

Steps are for Linux (Arch Linux)

Download git using below command

[x@archlinux ~]$ sudo pacman -S git

# To cross check fi it is installed

[x@archlinux ~]$ which git
/usr/bin/git #it is installed here - root -> bin -> git ; / ka matlab root hota hai

[x@archlinux ~]$ git --version
git version 2.52.0

Git Configuration

Git default branch ka naam Master rakhta hai is name ko change karne ke liye

Syntax: git config --global init.defaultBranch <name>


x@archlinux git]$ git config --global init.defaultBranch main

[x@archlinux git]$ git init
Initialized empty Git repository in /home/x/Documents/code-related-stuff/git/.git/
[x@archlinux git]$ git branch

[x@archlinux git]$ echo 'hi' > abc.md
[x@archlinux git]$ git add .
[x@archlinux git]$ git commit -m 'hi'
[main (root-commit) b8c12c6] hi
1 file changed, 1 insertion(+)
create mode 100644 abc.md
[x@archlinux git]$ git branch
* main
[x@archlinux git]$ 

Tell Git who you are

Configure Username & Email

# give global username
git config --global user.name "rishabh679"

#give global user email
git config --global user.email me.rishabhh.com

Git ki sari configuration setting dekhne ke liye

[x@archlinux ~]$ git config list
user.name=rishabh679
user.email=me.rishabhh.com
init.defaultbranch=main

#ye working dir le list ka example hai

(web-4-notes) [x@archlinux Web-4-Notes]$ git config --list
user.name=rishabh679
user.email=me.rishabhh.com
init.defaultbranch=main
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
branch.main.gk-last-accessed=2026-01-25T10:49:53.145Z
branch.main.gk-last-modified=2026-01-11T10:47:15.915Z
remote.my_github.url=https://github.com/rishabh679/web4notes.git
remote.my_github.fetch=+refs/heads/*:refs/remotes/my_github/*

Sher (شعر)

jo guzārī na jā sakī ham se
ham ne vo zindagī guzārī hai