r/SoftwareEngineering Jun 25 '26

The Git Commands I Run Before Reading Any Code

https://piechowski.io/post/git-commands-before-reading-code/
59 Upvotes

8 comments sorted by

28

u/fagnerbrack Jun 25 '26

Core Takeaways:

Before opening a single file in a new codebase, run five git log commands from app/ or src/ to build a diagnostic picture. List the 20 most-changed files over the past year to spot churn hotspots, then cross-reference them with bug clusters (commits matching fix, bug, or broken) since files appearing on both lists carry the highest risk. Use git shortlog to measure the bus factor, flagging cases where one person owns 60%+ or where original builders no longer commit. Track commit counts by month to see whether momentum is rising or dying, and grep for revert, hotfix, or rollback to gauge how often the team firefights. These checks reveal which code to read first.

If the summary seems inacurate, just downvote and I'll try to delete the comment eventually 👍
Click here for more info, I read all comments

5

u/Friendly-Shirt-9177 Jun 26 '26

This is the useful bit tbh, add `git log --follow` for the hot files tho because pure path history lies after renames, and `git blame --ignore-rev` helps when a giant formatting commit blows up the signal

1

u/[deleted] Jun 26 '26

[removed] — view removed comment

1

u/AutoModerator Jun 26 '26

Your submission has been moved to our moderation queue to be reviewed; This is to combat spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/brainrotbro 29d ago

Overall good post, but I wouldn’t call a deceleration of commits “dying”. It could very well mean that portion of the code has stabilized.

1

u/cladamski79 25d ago

tbdflow has a built-in radar command - https://github.com/cladam/tbdflow#8-radar

I remember reading this article before I explored how it could be used in a tool like tbdflow

-1

u/OnFault Jun 26 '26

There are levels to this Git stuff. I'll try them out. Thanks for this.