Ask HN: Is Git commit history useful to you?
2 points| hmdai | 1 year ago
1. When I'm trying to understand the context around a change that has been made to a file. usually the whole commit provides a better context. 2. When I want to revert a change that breaks the latest release. 3. Comparing branches for rebasing/merging
Are there any other use-case that people use git commit history for?
is commit history useful in other ways?
solardev|1 year ago
This is extremely useful for me when debugging something that I didn't write, to see who worked on it in the past – just those few lines – and what they changed. From there, then I can look at that whole commit and the ones right before/after it to get a better context if needed. But most of the time, just being able to see how those specific lines have changed really helps me understand the code, without the noise of an entire git history or even just file history, since often times it's other parts of the file that were changed. This feature limits it to only the lines I care about.
I wouldn't be able to work without this feature. VScode can do it too via the Gitlens extension. I don't think it's built-in to the git CLI, but you can kinda get a similar effect with some effort: https://stackoverflow.com/questions/10816578/can-git-show-hi....
Overall it's just much easier in Jetbrains (as many things are).
musicnarcoman|1 year ago
davydm|1 year ago
cratermoon|1 year ago
https://pragprog.com/titles/atcrime2/your-code-as-a-crime-sc...
Minor49er|1 year ago
janmarsal|1 year ago
ck45|1 year ago
threecheese|1 year ago
bdangubic|1 year ago
longnguyen|1 year ago