|
|
|
Ask HN: Is Git commit history useful to you?
|
|
2 points
by hmdai
581 days ago
|
|
I'm curious about how everyone here uses git commit history. I only use commit history for these use-cases: 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? |
|
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).