Daily Commands

Common commands for software engineers — organized by category. Click to copy when executable.

Dry run for clean

Preview files/dirs that would be removed.

git clean -n
gitcleandry-run

Remove untracked files

Force remove untracked files (no directories).

git clean -f
gitcleanfiles

Remove untracked files and directories

Force remove untracked files and directories.

git clean -fd
gitcleandirs

Override local with remote branch

Fetch and hard reset to remote branch; discards local changes/commits.

git fetch origin <branch> && git reset --hard origin/<branch> && git clean -fd
gitresetremoteoverride