简体   繁体   English

SVN 使用命令行添加和提交文件 - Tortoise SVN

[英]SVN Add and Commit File using Command Line - Tortoise SVN

On my machine Tortoise SVN is installed.在我的机器上安装了 Tortoise SVN。 I wanted to add and commit files using command line.我想使用命令行添加和提交文件。 When I tried svn add --force /path/to/your/project/* command I am getting 'svn' is not recognized as an internal or external command error.当我尝试svn add --force /path/to/your/project/* command 我得到'svn' is not recognized as an internal or external command error.

I also tried Tortoise commands:我还尝试了 Tortoise 命令:

TortoiseProc.exe /command:commit
                 /path:"c:\svn_wc\file1.txt*c:\svn_wc\file2.txt"
                 /logmsg:"test log message" /closeonend:0

TortoiseProc.exe /command:update /path:"c:\svn_wc\" /closeonend:0

TortoiseProc.exe /command:log /path:"c:\svn_wc\file1.txt"
                 /startrev:50 /endrev:60 /closeonend:0

It works but after hitting command SVN window will open.它可以工作,但在点击命令 SVN window 后将打开。 We need to click "OK" button manually.我们需要手动单击“确定”按钮。

Is there any way or commands to make automatically add and commit.有什么方法或命令可以自动添加和提交。

I don't know, if it is still actual but since I had the same issue not long ago, I think it's better to share some experience.我不知道,如果它仍然是实际的,但由于我不久前遇到了同样的问题,我认为最好分享一些经验。

First of all, TortoiseSVN is a GUI tool, you need to use "svn" commands.首先,TortoiseSVN 是一个 GUI 工具,你需要使用“svn”命令。 Install command line tool, if you didnt.安装命令行工具,如果你没有。

在此处输入图像描述

Second, try something like this:其次,尝试这样的事情:

@echo off
cd C:\path_to_your_files
svn add * --force
svn commit -m ""
pause

Command "add * --force" will add all files, then they will be committed with empty message.命令“add * --force”将添加所有文件,然后将它们提交为空消息。

Hope it might help.希望它可能会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM