Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN commit command

I need to commit the folder after adding some new files to that folder. When I tried this in TortoiseSVN, it was working properly (committed successfully), but while trying this by using the svn commit command it did not commit the folder.

Steps I have followed are:

  1. Checkout the test folder from the repository, to D:\Test folder,
  2. Add some new files to that test folder,
  3. Commit that folder using svn.exe commit D:\Test -m "Added".

It was not committed. I have tried this in TortoiseSVN (right-click on that folder and click SVN Commit), and it committed successfully.

like image 638
user1553605 Avatar asked Dec 13 '12 12:12

user1553605


People also ask

What is the use of svn commit command?

svn commit will send any lock tokens that it finds and will release locks on all PATH s committed (recursively) unless --no-unlock is passed. If you begin a commit and Subversion launches your editor to compose the commit message, you can still abort without committing your changes.

What is svn commit and update?

Commit uploads your changes on the CVS / SVN server, and Update overwrites the files on your localhost with the ones on the server.


2 Answers

To add a file/folder to the project, a good way is:

First of all add your files to /path/to/your/project/my/added/files, and then run following commands:

svn cleanup /path/to/your/project  svn add --force /path/to/your/project/*  svn cleanup /path/to/your/project  svn commit /path/to/your/project -m 'Adding a file' 

I used cleanup to prevent any segmentation fault (core dumped), and now the SVN project is updated.

like image 174
Petre Sosa Avatar answered Sep 20 '22 19:09

Petre Sosa


Command-line SVN

You need to add your files to your working copy, before you commit your changes to the repository:

svn add <file|folder> 

Afterwards:

svn commit 

See here for detailed information about svn add.

TortoiseSVN

It works with TortoiseSVN, because it adds the file to your working copy automatically (commit dialog):

If you want to include an unversioned file, just check that file to add it to the commit.

See: TortoiseSVN: Committing Your Changes To The Repository

like image 42
jens-na Avatar answered Sep 18 '22 19:09

jens-na