git init
add changes to stage in the local
git add <files or directories>
add all changes in the local
git add .
commit changes to new commmit object being ready for remote repository
git commit -m "<comment>"
amend last commit message
git commit --amend -m <new message>
push the committed changes to the remote repository
git push <remote> <branch>
pull changes in the remote repository
git pull <remote> <branch>
git branch
switch to the selected branch
git checkout <branch>
create a new branch and swich to it
git checkout -b <new branch name>
git branch -d <branch name>
git push origin --delete <branch name>
set upstream for a local branch
git branch --set-upstream-to=origin/<remote branch> <local branch>
update local repository with remote branch references
git fetch
restore working tree files in the current directory
git restore .
save the current changes in stash
git stash
|| git stash save "some comment to the changes"
display all stashed changes
git stash list
display changes of selected stash
git stash show -p <stash name>
apply stashed changes but keep the stashed
git stash apply <stash name>
apply stashed changes and delete the stashed
git stash pop <stash name>
delete selected stashed changes
git stash drop <stash name>
delete all stashed changes
git stash clear
reset to a certain commit with soft
git reset --soft <commit hash>
reset to a certain commit with hard
git reset --hard <commit hash>
force push with reset local branch
git push --force-with-lease origin <branch name>
git update-index --assume-unchanged <file name>
git update-index --no-assume-unchanged <file>