Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

SVN commit operation

SVN commit operation

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


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



root@runoob:~/svn/runoob01/trunk# cat readme 

this is SVN tutorial.

View the status in the working copy.



root@runoob:~/svn/runoob01/trunk# svn status

?       readme

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

Add the file readme to version control, waiting to be committed to the repository.



root@runoob:~/svn/runoob01/trunk# svn add readme 

A         readme

View the status in the working copy



root@runoob:~/svn/runoob01/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 message to commit.

If you omit the -m option, SVN will open a text editor where you can enter multiple lines to input the commit message.



root@runoob:~/svn/runoob01/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.