DVCS - How often and when to commit changes

后端 未结 5 1819
闹比i
闹比i 2020-12-08 04:49

There is another thread here on StackOverflow, dealing wih how often to commit changes to source control. I want to put that in the context of using a DVCS like git or mercu

5条回答
  •  北海茫月
    2020-12-08 05:03

    I commit a lot; when adding functions or even reformatting my sources.

    I use git and do most of my work on non-shared branches. And when I've added enough little changes that count as a block, I use git rebase to collect the smaller related changes into larger chunks and commit that to the main branches.

    This way, I have all the advantages of committed code that I can go backwards or forwards in, but I don't have to commit all my mistakes, and bactracks to the main history.

提交回复
热议问题