For older notes: https://sahilrajput03.github.io/Git_and_GitHub.html
git --no-pager log
git --no-pager show <commit_hash>
git branch
: Prints all branches and * indicated is the current branch.
git branch test
: will make test
named branch.
git branch somebranch SourceBranchHere
will make somebranch
named branch.
git checkout branchName
git log
git pull
vs. git pull origin
vs. git pull origin main
SD-499
which was checked out from main.git pull
or git pull origin
, this will only fetch and merge all remote branches to their respective local branches which set set t to tracked.main
branch into your current branch either by doing git merge main
or you can do it by git pull origin main
as both will do same thing. Why? Ans. Because git pull origin main
will pull update local main branch first and second it will merge main
branch to your currently checkout branch
. BECAUSE git pull
= git fetch
+ git merge branch
. Source: Atlassian, Git-scmThat can work actually.
.git
folder any whereYes, it sounds quite unbelievable but its quite magical how it does work actually. Amazing Linus Torwald.
.gitkeep
fileTLDR: (its just a simple conventional hack by people to make a empty folder be indexable)
Docs: .gitignore @ SCM
Stackoverflow Answer: Click here
*
to a nested folder’s .gitignore
ignore all files including the .gitignore
file as well*
to root .gitignore
file ignore all entitiesThats all.