Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How often should I commit

Jos “jdeca” O
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 9, 2018

Hi all,

I'm new to Sourcetree, but I've been using SVN for sometime now. My question is, how often should I commit? What is the recommended way? In SVN, I would create a branch, check it out, work on changes that would sometimes take days, then check in. Most of the time, I would have multiple changes\files with my check in. I'm currently watching a Pluralsight video by Xavier Morera, who suggests to commit often. How often would that be? Not sure if committing every small change is a good idea.

Thanks in advance.

3 answers

1 vote
Steve Thornhill
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2018

I don't believe there is a definitive answer to that.

It comes down to how the repository is being used.

If it is just you working on it, then commit when you need to.

If there are other people using the same code, then the more often you commit, the easier it is for them to pick up on changes.

You can work the same way as you used to, check out a branch and make any changes, knowing that the master will contain the original code - and then merge or delete, depending on whether you need the changes.

0 votes
Jos “jdeca” O
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 9, 2018

Thanks for your replies.

Committing often, perhaps also helps with documenting your changes... by adding meaningful comments when committing of course. For my documentation, when checking in in SVN, I would go file by file to review what I'd changed and based on that, I would create my documentation. Our plan for now is that one developer will be working on a feature branch at a time.

 

Thanks again.

0 votes
bgannin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 9, 2018

Hi Joe,

My advice is to trust your gut but aim for safety. If you get the basics working, that's a great time to commit before refactoring for final form. If you have a portion you'd like to snapshot (like, I got the UI done) that's another fine commit milestone. I like to do stages (got X part done, got Y part done, got X+Y wired up, add Z, etc.) and then wrap up in that merge commit which makes it all clean 😃HTH

Cheers,

Brian Ganninger
Senior Mac Developer, Sourcetree

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events