Git commit and push quick reference for this repository.
Use this skill when the task is about staging changes, creating commits, pushing branches, amending commits, stashing work, or inspecting git history.
git status
git diff
git diff --cached
git add .
git add <path>
git add -p
git commit -m "feat: short summary"
git commit
git commit -am "fix: short summary"
git push
git push origin main
git push -u origin <branch>
git push --force-with-lease
git commit --amend -m "new message"
git add <missed-file>
git commit --amend --no-edit
If the amended commit has already been pushed:
git push --force-with-lease
Prefer non-destructive commands unless the user explicitly asks otherwise.
git restore --staged <path>
git reset HEAD <path>
git restore <path>
git reset --soft HEAD~1
git reset HEAD~1
Avoid git reset --hard unless the user explicitly requests destructive history/worktree reset.
git stash
git stash -u
git stash list
git stash pop
git stash apply stash@{0}
git stash drop stash@{0}
git log
git log --oneline
git log --graph --oneline --all
git log -n 5
git log <path>
git status
git checkout --ours <path>
git checkout --theirs <path>
git add <path>
git commit -m "resolve merge conflict"
git merge --abort
feat:, fix:, refactor:, docs:, test:, chore:.