git init
git checkout -b <branch_name>
git push origin <branch_name> // If pushing it also to remote
git branch -m <oldname> <newname>
git commit -m “message”
git rebase -i HEAD~<position_in_the_log>
git reset HEAD^
Create commits as desired
git add <file> // single file
git add -A // all unstaged files
git reset HEAD — <file>
git checkout .
git push --set-upstream origin <branch_name> // First time
git push // Remaining times
git push -f // If history changed
git rebase <base_branch>
git rebase -i HEAD~<position_in_the_log>
git rebase --onto <new_base_branch> <old_base_branh> <target_branch>
1 - branches can be either names or hash values
2 - target branch only if target is not the current branch
git add -A
git stash
git stash apply // If only entry
git stash apply stash@{<INDEX>} // If multiple entries
git status
git diff
git log --graph --pretty=oneline