git init
git status
git add .
git commit -m <commit-message>
git restore --staged <file-name>
git log
To get back to prev commit or to remove all the commits after a particular commit, All the modified files are moved to unstaged area
git reset <commit hash ID>
git add <files> ; git stash
git stash pop
git stash clear
git remote add origin <url>
git remote -v
format : git push <name assigned to url (origin for personal git account)> <branch-name>
git push origin main
git push origin main -f
git branch <branch-name>
git checkout <branch-name>
Adding an upstream url(The url of the original git repo from where the you have forked it) after forking a repo
git remote add upstream <url-name>
git fetch
git reset --hard <branch-name>
git branch --list
git branch <branch-name> -d
git config --list
git config --global --list
git help <command>
git reset <commit-ID of the commit after which all the commits have to be merged>; git add .;git commit -m <message for merging commits>
git rebase -i <commit-ID of the commit after which all the commits have to be merged>