this post was submitted on 22 Jun 2023
11 points (92.3% liked)
Git
2886 readers
20 users here now
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Resources
Rules
- Follow programming.dev rules
- Be excellent to each other, no hostility towards users for any reason
- No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.
Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I don't think these tips have anything to do with improving workflow per se.
Every alias/setting listed comes by default with any decent git gui. Personally I recommend Fork because of how easy it is to stage only specific lines, making it easy to split commits into logical chunks rather than by line-position chunks while also showing the git commit graph.
Improving workflow itself comes down to writing your code in a way that's easy to review.
You can achieve that by:
Some devs get confused by the last point, so without writing a code example, here's the do's-and-don'ts:
I am almost giving up on this except for personal projects. I still use this as much as possible even in work projects. But most enterprise clients even the ones from US and UK don't seem to care about this anymore.
It's easy to mandate, the server has a githook that disallows any push that contains a commit that doesn't follow the standard.
Anyone who makes a bunch of commits on their end, then tries to push them will see an error message returned by the server pointing them to the standard. They then just have to rename their commits through an interactive rebase and repush. Interactive rebase is stupidly easy with most git-guis and easy enough for terminal users who have forgotten the commands through a 30 second youtube short.
I would love to do this and I will explore this.
What I have most issue with is the imperative mood — So many devs (in one case a very well-spoken EM), just say Added so and so changes instead of Add so and so changes.
I would like to know if this type of thing can be detected in a githook. What I usually do is educate the team I lead, but it all breaks/becomes harder when we either join another team for a duration or some other teams' senior devs join our team(s).
It's pretty hard to teach what imperative mood is.
English is hard to lint, but not impossible. See the Vale linter (not to be confused with the vale language)
I would love to annoy some people with this. But seriously, thank you for the recommendation. This is incredible.