Difference between `svn add` and `svn commit` in Apache Subversion

Reema picture Reema · Aug 18, 2015 · Viewed 12.2k times · Source

What is the difference between Add and Commit in SVN?

I understand that Add adds a new file to SVN and Commit updates any changes done for an already existing file in the SVN

My question is, do I need to do a Commit after adding new files using Add?

Answer

bahrep picture bahrep · Aug 18, 2015

There is a great chapter in SVNBook which describes basic workflow with Subversion: SVNBook | Basic Work Cycle. The chapter explains, that svn add et all are commands related to making changes and svn commit is a command which publishes these changes to a repository as a new revision.

  • svn add adds an item (file or directory) to a local working copy. svn add is a local operation and does not contact server. No changes made to a repository when you run svn add. It simply schedules and item to be committed to a repository next time your run svn commit.

  • svn commit commits changes to a repository.