SVN Commit Operation
In the previous chapter, we checked out the repository tutorialpro01, and the corresponding directory is located at /home/user01/tutorialpro01. Now, we will perform version control on this repository.
We need to add a readme file for instructions in this repository.
root@tutorialpro:~/svn/tutorialpro01/trunk# cat readme
this is SVN tutorial.
Check the status of the working copy.
root@tutorialpro:~/svn/tutorialpro01/trunk# svn status
? readme
At this point, the status of readme is ?, indicating that it has not been added to version control.
Add the file readme to version control, ready for submission to the repository.
root@tutorialpro:~/svn/tutorialpro01/trunk# svn add readme
A readme
Check the status of the working copy again.
root@tutorialpro:~/svn/tutorialpro01/trunk# svn status
A readme
Now, 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 submit.
If you omit the -m option, SVN will open a multi-line text editor for you to enter the commit message.
root@tutorialpro:~/svn/tutorialpro01/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 been automatically incremented by 1.