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.
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.
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
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.
Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...
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