如何从任何目录启用svn命令?

时间:2022-07-08 22:55:58

I have recently installed SVN on Windows Server 2003. I can execute svn commands in the command prompt if I am in the bin directory (program files\subversion\bin). But trying to execute commands in any other directory results in

我最近在Windows Server 2003上安装了SVN。如果我在bin目录(program files \ subversion \ bin)中,我可以在命令提示符下执行svn命令。但是尝试在任何其他目录中执行命令会导致

'svn' is not recognized as an internal or external command, operable program or batch file

'svn'不被识别为内部或外部命令,可操作程序或批处理文件

Where am I going wrong here?

我在哪里错了?

EDIT I checked the Path value in environment variables and it is in there. I added for my user as well as system just in case but no joy?

编辑我检查了环境变量中的Path值,它就在那里。我为我的用户和系统添加以防万一,但没有喜悦?

EDIT Just magically started working. Random

编辑只是神奇地开始工作。随机

3 个解决方案

#1


You need to add the folder that holds the svn binary to your PATH environment variable.

您需要将包含svn二进制文件的文件夹添加到PATH环境变量中。

To do this, hit Windows+Pause, then click the Advanced tab, and the Environment Variables button, and enjoy the horrible editor.

要执行此操作,请单击Windows + Pause,然后单击Advanced选项卡和Environment Variables按钮,并享受可怕的编辑器。

UPDATE: Note that the environment works by inheritance, it's not a global "thing" that you edit, think of it as a template that is inherited by every newly started program. So, if you open a command window, type "svn" and get the "not found" error, then edit the path in the dialog descvribed above and try again, nothing will happen.

更新:请注意,环境通过继承工作,它不是您编辑的全局“事物”,将其视为每个新启动的程序继承的模板。因此,如果您打开命令窗口,键入“svn”并获取“未找到”错误,然后在上面描述的对话框中编辑路径并再试一次,什么都不会发生。

This is because the command window is working using its copy of the environment, which it got when it was started. So, after you change the environment variables, open a new command window and it should work.

这是因为命令窗口正在使用它在启动时获得的环境副本。因此,在更改环境变量后,打开一个新的命令窗口,它应该可以工作。

#2


You probably don't have ...\subversion\bin in your PATH.

你的PATH中可能没有... \ subversion \ bin。

#3


You need to add that folder to the path:

您需要将该文件夹添加到路径:

Right click My Computer > Properties > Advanced > Environment Variables

右键单击我的电脑>属性>高级>环境变量

and edit the Path property to include program files\subversion\bin

并编辑Path属性以包含程序files \ subversion \ bin

#1


You need to add the folder that holds the svn binary to your PATH environment variable.

您需要将包含svn二进制文件的文件夹添加到PATH环境变量中。

To do this, hit Windows+Pause, then click the Advanced tab, and the Environment Variables button, and enjoy the horrible editor.

要执行此操作,请单击Windows + Pause,然后单击Advanced选项卡和Environment Variables按钮,并享受可怕的编辑器。

UPDATE: Note that the environment works by inheritance, it's not a global "thing" that you edit, think of it as a template that is inherited by every newly started program. So, if you open a command window, type "svn" and get the "not found" error, then edit the path in the dialog descvribed above and try again, nothing will happen.

更新:请注意,环境通过继承工作,它不是您编辑的全局“事物”,将其视为每个新启动的程序继承的模板。因此,如果您打开命令窗口,键入“svn”并获取“未找到”错误,然后在上面描述的对话框中编辑路径并再试一次,什么都不会发生。

This is because the command window is working using its copy of the environment, which it got when it was started. So, after you change the environment variables, open a new command window and it should work.

这是因为命令窗口正在使用它在启动时获得的环境副本。因此,在更改环境变量后,打开一个新的命令窗口,它应该可以工作。

#2


You probably don't have ...\subversion\bin in your PATH.

你的PATH中可能没有... \ subversion \ bin。

#3


You need to add that folder to the path:

您需要将该文件夹添加到路径:

Right click My Computer > Properties > Advanced > Environment Variables

右键单击我的电脑>属性>高级>环境变量

and edit the Path property to include program files\subversion\bin

并编辑Path属性以包含程序files \ subversion \ bin