My Git Cheatsheet for Reference
It is
.
.
Untracked: New Files that git doesn't yet track
Modified: Changed
Staged: Files ready to commit
unmodified: unchanged
git config --global user.name "MyName"
git config --global user.email "MyEmail"
git config --list
git init
git remote add origin <link>
# To Verify Remote
git remote -V
git branch
# To Rename Branch
git branch -M main
# To Delete Branch
git branch -d old-branch
git checkout <branch name>
git checkout -b <new branch name>
git clone [url]
# add - adds new or changed files in your working directory to the Git staging area.
git add <file name>
# commit - it is the record of change
git commit -m "some message"
git push origin master
git diff <branch name>
git merge <other branch name>
git pull origin master
# Case 1: Unstaged Changes
git reset <file name>
# Case 2 : commited changes (for one commit)
git reset HEAD~1
Case 3 : commited changes (for many commits)
git reset <- commit hash ->
# get commit hash code from > git logs
git reset -- hard <- commit hash ->
git tag -a v1.0 -m "First Release"
git tag