Add changes to most recent commit
git commit --amend --no-edit
Reset/clear uncommitted changes
git restore -s HEAD .
Get the most recent commit message
git log -1 --pretty=%B
Get the most recent commit hash
git rev-parse HEAD
Check if you are inside of a repository
git rev-parse --is-inside-work-tree
Get the current branch
git branch --show-current
Get the default branch name from origin remote
git remote show origin | grep 'HEAD branch' | cut -d' ' -f5