It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How often should I commit

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

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

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

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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,935 views 0 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you