SVN commit command
Solution 1
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.
Solution 2
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
Solution 3
First add the new files:
svn add fileName
Then commit all new and modified files
svn ci <files_separated_by_space> -m "Commit message|ReviewID:XXXX"
If non source files are to be committed then
svn ci <files> -m "Commit msg|ReviewID:NON-SOURCE"
Comments
-
user1553605 about 2 years
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:
- Checkout the test folder from the repository, to
D:\Test
folder, - Add some new files to that test folder,
- 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.
- Checkout the test folder from the repository, to
-
Anonymous over 4 yearsWhen I use
svn add --force D:\ABC\sample\v1.0.0
command I am gettingsvn: E155007: 'D:\ABC' is not a working copy directory
. Any solution for this -
Uwe Keim about 2 yearsIn my case on Windows, putting the commit message into single quotes lead to an error. I succeeded with putting everything into double quotes like e.g.
"c:\path\to\svn.exe" commit "c:\path\to\your\project" -m "Adding a file."
.