Show a file's change history
Show every diff of a file, following renames
git log --follow -p -- path/to/file.py
- tool
- git45 commands
More git commands
-
git reset --soft HEAD~1Move HEAD back one commit. Your changes stay staged
-
git clean -fdDelete untracked files and directories from the working tree. Ignored files stay
-
git branch --merged mainList local branches already merged into main. These are safe to delete
-
git rebase -i HEAD~5Squash, reorder, or edit the last 5 commits
-
git cherry-pick <sha>Apply one commit from another branch to the current one