4 ms·
I thought this was going to be about someone meticulously doing git commits after every tiny little change.
by erikpukinskis 15y ago
I thought this was going to be about someone meticulously doing git commits after every tiny little change.
- treetrouble 15y agoI'd like to read a post about the optimal granularity of git commits in different situations. I don't think I'm experienced enough particularly when it comes to intense collaboration to write it myself
- merlincorey 15y agoIt depends somewhat on your perspective. Some people like to lie, and others do not[1]. Personally, I don't mind lying a bit in my personal projects. To lie, you simply make a new branch for each feature or otherwise related changeset such as a hotfix. Within that branch, you make as many commits as you want, the more the merrier. When the branch is ready to merge, you use "git merge --squash branchname" which will pull in the changes from branchname in an uncommited form. Then, you can use "git diff" to view the differences and make one single commit with an appropriate commit message detailing each change. The upside is that it is atomic without needing to use the git-workflow no fast-forward business. The downside is you're lying. [1] http://paul.stadig.name/2010/12/thou-shalt-not-lie-git-rebase-ammend.html http://paul.stadig.name/2010/12/thou-shalt-not-lie-git-rebas...
- inerte 15y agoMy granularity is: Different things go on different commits. For example, you can include 30 files and hundreds of lines in one changeset if they are all related to the new feature X, but do not in the same changeset correct the indentation of a code block. The commit message is like a title. All diff lines must be related to it or they should be in another changeset.
- pjscott 15y agoI thought it was either that, or someone who carefully used fast-forward merges and rebasing to give the illusion of a completely serial history for a project that actually involved a fair amount of branching.
- mynegation 15y agoWell, I first guessed topic right from the title, but then I noticed domain name and second-guessed myself, thinking that this is witty title for what you described. Then again that may be like the second-level of wittiness by the author to host this blog entry on the github. Reminds me this classic scene from the "Princess Bride".
- oacgnol 15y agoWhen I first started using revision control on a work project, I used to commit after every few lines to "save" my work. Without commit messages. Boy, did I pay for that one.
- cmurdock 15y agoI first used Git before I really understood source code control and more or less did the same thing. Kept it up until a friend of mine that I was working on the project with figured out that there had been upwards of 200 commits in one day with no commit messages. Oops.
- devs1010 15y agome too, I worked with a guy who did that, it was annoying when looking over his revisions, during a period of 1-2 days of work (on a project with just 2 people committing on it), the rev number would increase by 50 sometimes
- baconhigh 15y ago^ this