使用SVN添加新文件

时间:2016-06-22 06:20:33

标签: svn version-control

我有一个名为2016的文件夹,我有一堆项目。我刚刚添加了2个新项目wap-sprintwap-sprint-2然后我做了:$ svn add --force .并在控制台中得到了这个:

Marcelo@MacBook-Pro-de-MarceloRS /L/W/D/2016> svn add --force .
A         wap-sprint-2
A         wap-sprint-2/assets
A         wap-sprint-2/assets/css
A         wap-sprint-2/assets/css/legal.css
A         wap-sprint-2/assets/css/index.css
A         wap-sprint-2/assets/img
A         wap-sprint-2/assets/img/index
A  (bin)  wap-sprint-2/assets/img/index/img01.png
A  (bin)  wap-sprint-2/assets/img/index/img02.png
A  (bin)  wap-sprint-2/assets/img/index/img03.png
A  (bin)  wap-sprint-2/assets/img/index/img04.png
A         wap-sprint-2/includes
A         wap-sprint-2/includes/legal1-endoflease.php
A         wap-sprint-2/includes/target1-endoflease.php
A         wap-sprint-2/includes/target2-promotionalupgrade.php
A         wap-sprint-2/legal.php
A         wap-sprint-2/index.php
A         wap-sprint
A         wap-sprint/includes
A         wap-sprint/includes/target2-promotionalupgrade.php
A         wap-sprint/includes/legal1-endoflease.php
A         wap-sprint/includes/target1-endoflease.php
A         wap-sprint/legal.php
A         wap-sprint/index.php
A         wap-sprint/assets
A         wap-sprint/assets/css
A         wap-sprint/assets/css/legal.css
A         wap-sprint/assets/css/index.css
A         wap-sprint/assets/img
A         wap-sprint/assets/img/index
A  (bin)  wap-sprint/assets/img/index/img01.png
A  (bin)  wap-sprint/assets/img/index/img02.png
A  (bin)  wap-sprint/assets/img/index/img03.png
A  (bin)  wap-sprint/assets/img/index/img04.png

如您所见,有两个新项目,我上面提到的项目。现在我想提交这些新项目,以便我的同事可以在他们的计算机中看到它们,所以我做了:$ svn commit我得到了这个:

Marcelo@MacBook-Pro-de-MarceloRS /L/W/D/2016> svn ci
svn: E205007: Commit failed (details follow):
svn: E205007: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the --message (-m) or --file (-F) options

如果我$ svn status,我得到的输出与我$ svn add --force .时的输出完全相同

你知道发生了什么吗?

1 个答案:

答案 0 :(得分:1)

add操作按预期工作,这就是status操作提供相同输出的原因。如果您指定了要添加的文件夹,则不需要--force

svn add wap-sprint wap-sprint2

更改尚未提交,并且Subversion不允许您在没有显式提交消息的情况下提交,即使它是空的。很显然抱怨它......

(...) Could not use external editor to fetch log message (...)

因此,正如它建议的那样,要么设置一个环境变量......

(...) consider setting the $SVN_EDITOR environment (...)

这将使它在您想要提交时启动编辑器但不提供任何提交消息,或者只是在命令行上提供提交消息:

# directly
svn ci -m "added 2 new projects, yadda, yadda"
# alternatively: empty commit message
svn ci -m ""
# alternatively: commit message from file
svn ci -F commitmessage.txt