GitPractice

Youtube 1: https://www.youtube.com/watch?v=HVsySz-h9r4

Check Git version
git --version - To check the current version of the git installed in your local machine

Set Git global config
git config --global user.name "Krunal Badami"
git config --global user.email "krunalbadami@gmail.com"

Check Git global configuration
git config --list

Get help
git help config
git config --help

Tracking non-git project
git init

Track changes
git status

Create gitignore file
touch .gitignore

Stage changes
git add .gitignore
git add -A

Un-stage changes
git reset .gitignore
git reset

Commit
git commit -m "Your custom message"

Get Latest commit
git log

Clone Repo
git clone <url>
git clone <https://username@git-url.git>
git clone <url> <where-to-clone>

Get difference
git diff

Pull
git pull origin <branch-name>
git pull

Push
git push origin <branch-name>
git push -u origin <branch-name>
git push

Create Branch
git branch <branch-name>

Checkout branch (Change your local branch)
git checkout <branch-name>

List all local branches
git branch

List all local/remote branches
git branch -a

List merge branches
git branch --merged

Merge branche
git merge <branch-name>

Delete local branch
git branch -d <branch-name>

Delete remote branch
git push origin --delete <branch-name>