Learn git

For older notes:

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


git log

Remove a .env file from entire history of the repo

Click here

What is .gitkeep


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


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


View the commit diff of merged commit?

That can work actually.


♥💕❤😘 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



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


Adding * to root .gitignore file ignore all entities

Thats all.