git clone <repository link> | Clone (download) repository |
git clone <repository link> -b <branch> | Clone (download) repository for the mentioned branch |
git branch | Show branch |
git log -<number> | Show last number commits |
git status | Show information about changes done |
git commit -m <commit comment> | Commit the changes (locally) |
git push | Push the commmits to repository |
git reset --hard <commit hex id> | Reset codebase to particular commit |
git pull | Take latest from (developer) branch |
git pull origin master |
Take latest from master branch (look for "<<<<<<< HEAD" and ">>>>>>>" for Merge conflicts) |
git merge --abort | Abort above pull |
git show --pretty="" --name-only <commit hex id> | To see files under a commit |
git log <file> | To see commits under which file was changed |
Copyright © Samir Amberkar 2025