sahilrajput03

Learn git

For older notes: https://sahilrajput03.github.io/Git_and_GitHub.html

disable pager in git output

git --no-pager log
git --no-pager show <commit_hash>

show all branch

git branch: Prints all branches and * indicated is the current branch.

Creating new branch

git branch test : will make test named branch.

git branch somebranch SourceBranchHere will make somebranch named branch.

switching to other branch

git checkout branchName

logs

git log

Remove a .env file from entire history of the repo

Click here

What is .gitkeep

image

this is how you include a folder with a single file .gitkeep but ignore its other contens for personal usage for each team member

image

git pull vs. git pull origin vs. git pull origin main

image

View the commit diff of merged commit?

That can work actually.

image

♥💕❤😘 You can literally move your .git folder any where

Yes, it sounds quite unbelievable but its quite magical how it does work actually. Amazing Linus Torwald.

What is .gitkeep file

TLDR: (its just a simple conventional hack by people to make a empty folder be indexable)

Docs: .gitignore @ SCM

Stackoverflow Answer: Click here

image

image

Addging * to a nested folder’s .gitignore ignore all files including the .gitignore file as well

image

Adding * to root .gitignore file ignore all entities

Thats all.