Discard local changes
Discard unstaged edits in tracked files and delete untracked files and directories
git restore . && git clean -fd
More git commands
-
git tag -l -n1List all tags with the first line of each annotation
-
git tag -s v1.2.3 -m 'Release 1.2.3'Create an annotated tag signed with GPG for a release
-
git fetch --pruneRemove local refs to remote branches that no longer exist
-
git clone --depth=1 --single-branch --branch main <url>Clone only the latest commit of one branch. Good for fast CI checkouts
-
git shortlog -sn --allRank authors by their total number of commits