When I commit something to SVN, should I update first my local copy, or the merging is automatically done ?
In other words, should I always update before committing, or can I just commit ?
Commit uploads your changes on the CVS / SVN server, and Update overwrites the files on your localhost with the ones on the server.
Select any file and/or folders you want to commit, then TortoiseSVN → Commit.... The commit dialog will show you every changed file, including added, deleted and unversioned files. If you don't want a changed file to be committed, just uncheck that file.
The SVN update Command. The svn update command lets you refresh your locally checked out repository with any changes in the repository HEAD on the server. It also tells you what has been changed, added, deleted. If a change has been made to a file you have also changed locally, svn will try to merge those changes.
svn commit will send any lock tokens that it finds and will release locks on all PATH s committed (recursively) unless --no-unlock is passed. If you begin a commit and Subversion launches your editor to compose the commit message, you can still abort without committing your changes.
Yes you should.
While its not always necessary, it's a good idea to do so.
Imagine someone else changes something that wouldn't result in a conflict but has a reaction on your changes. Then, you would check in and the version on the server is not that what you tested.
So, before committing, always do an svn update
to ensure that your changes still behave like you thought they do: test the version that is in your WC, if your commit is still reasonable, do it. In case of errors, fix them before committing to the repo.
Merging in Centralized Version Control Systems (CVCS) like subversion is always done before commits so you should update, test (if there are changes), then commit.
Good e-book -Version Control by Example (free) comparing CVCS and DVCS is available here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With