Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How often should a programmer commit to SVN?

Tags:

svn

What is the general rule? When do you commit?

like image 567
TIMEX Avatar asked Nov 11 '09 04:11

TIMEX


People also ask

How frequent should you commit?

The general rule (for both scenarios) would be: Commit as often as possible. If you think "it's not ready yet" (because it'll break the build or simply isn't done yet) then create a branch and commit to that branch but make sure you do commit.

What are two best practices while working with svn?

Establish a branching and tagging practice. Tag major bug fixes at the beginning and end of the work. Maintain tags (and possibly branches) for production/qa releases.

How often should you git add?

Depends on your source code system and what else you have in place. If you're using Git, then commit whenever you finish a step. I use SVN and I like to commit when I finish a whole feature, so, every one to five hours. If I were using CVS I'd do the same.


4 Answers

Commit early and often. It minimizes conflict resolution steps when working in a team. But don't commit anything that breaks your build. Ideally, continuous integration notifies the team when the build breaks.

like image 149
Asaph Avatar answered Nov 16 '22 01:11

Asaph


I try to commit whenever I complete a 'piece' of work - as long as the code compiles, of course.

like image 30
Blorgbeard Avatar answered Nov 16 '22 00:11

Blorgbeard


This is covered (and covered well) in an older post on best practices.

SVN best-practices - working in a team

I'm recommending checking out this post because it covers a lot of good ideas, not just how often to commit.

like image 36
David Avatar answered Nov 16 '22 02:11

David


If working on trunk, I commit whenever I hit a milestone that won't impact my teammates. When working on a private branch, I commit whenever I hit a milestone I don't want to lose (I don't care if it even builds). For personal projects, I use mercurial and commit constantly. It all depends on what works for you and your team.

like image 31
Stephen Newell Avatar answered Nov 16 '22 02:11

Stephen Newell