next up previous contents
Next: Examing the differences between Up: Basic Operations Previous: Checkout a project   Contents

Commiting files and showing their status

Now we are ready to edit files and commit them back to the repository:

$ echo "Important text" >> readme.txt
$ svn status
M      readme.txt

The command svn status shows the status of the files - if they are up-to-date, locally modified, merged or if the contains conflicts. In the case about it says that readme.txt is locally modified. We can commit with the command

$ svn ci -m "more readme" readme.txt
Sending        readme.txt
Transmitting file data .
Committed revision 2.

The file is committed and the revision of the repository is incremented to two. The commits in Subversion are atomic - no matter how many files we send in one commit the repository revision is incremented only by one:

$ echo "Install notes" > install.txt
$ svn status
?      install.txt
$ svn add install.txt
A         install.txt
$ echo "more readme" > readme.txt
$ svn status
A      install.txt
M      readme.txt
$ svn commit -m "install notes and readme"
Adding         install.txt
Sending        readme.txt
Transmitting file data ..
Committed revision 3.

We create a new file intall.txt and add it to the repository with add. Then we change readme.txt again and commit the file and create the next revision. When svn commit is invoked with no files, it recursively commits all modified files in the current directory.



Ivan Ivanov 2008-04-21