Useful Git Commands Make git repository //You ned to go inside the project folder git init Clone repo git clone <repo link> Setting Git configs git config --global user.name <name> git config --global user.email <email> Check repo status git status Display commit history git log Stage a file for commit git add <file> Stage all changes for commit git add -p Commit the staged changes git commit -m "<message>" Push changes to remote git push Get all changes from from git fetch Pull changes to current branch git pull Create branch git branch <branch name> Switch to branch git checkout <branch name> Publish new branch git push --set-upstream <remote name (origin by default)> <branch name> See the changes you have made git diff Save the current changes for later use (already tracked files) git stash Save the current changes for later use (untracked files) git stash -u Apply the last saved chanegs git stash apply Rollback to previos commit //Safe way git revert HEAD/<commit> //Dangerous way git reset Merging one branch to another git merge <branch name> Merging one branch to another with merge commit git merge --no-ff <branch name>