SVN Commit Operation

In the previous chapter, we checked out the repository example01, and the corresponding directory is placed in /home/user01/example01. Now we will perform version control on this repository.


We need to add a readme description file to the repository.

root@example:~/svn/example01/trunk# cat readme 
this is SVN tutorial.

View the status of the working copy.

root@example:~/svn/example01/trunk# svn status
?       readme

At this point, the status of readme is ?, which means it has not been added to version control.

Add the file readme to version control, pending commit to the repository.

root@example:~/svn/example01/trunk# svn add readme 
A         readme

View the status of the working copy

root@example:~/svn/example01/trunk# svn status     
A       readme

At this point, the status of readme is A, which means the file has been successfully added to version control.

To store readme in the repository, use commit -m with a comment to commit.

If you omit the -m option, SVN will open a text editor that allows multiple lines of input for you to enter the commit message.

root@example:~/svn/example01/trunk# svn commit -m "SVN readme."
Adding         readme
Transmitting file data .
Committed revision 8.
svn commit -m "SVN readme."

Now readme has been successfully added to the repository, and the revision number has automatically incremented by 1.

Other Extensions