Linux 如何为文件设置“执行”属性并在 Windows 的 SVN 中检查它?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6874085/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 05:20:52  来源:igfitidea点击:

How to set "execute" attribute to a file and check it in SVN from Windows?

linuxwindowssvnbamboofile-attributes

提问by Mark

I have SVN configured in Linux at a different location and I need to check-in a shell script to SVN with executable attribute ON from Windows. I use Bamboo as CI, which checks out sources from SVN and does the periodic build. It throws error that shell script is not executable. (Bamboo run as root).

我在 Linux 中的不同位置配置了 SVN,我需要将 shell 脚本签入到 SVN,并且 Windows 的可执行属性为 ON。我使用 Bamboo 作为 CI,它检查来自 SVN 的源并进行定期构建。它抛出错误,shell 脚本不可执行。(Bamboo 以 root 身份运行)。

What is the best way to set the executable permission?

设置可执行权限的最佳方法是什么?

I don't use any SVN client and use eclipse to check-in and check-out. If SVN client is the only, how do I find a version that is compatible with SVN plugin that I use in eclipse. I had a compatibility problem earlier. When I checked-in a file from Tortoise, I couldn't checkout that file from Eclipse.

我不使用任何 SVN 客户端,而是使用 eclipse 进行签入和签出。如果只有 SVN 客户端,我如何找到与我在 eclipse 中使用的 SVN 插件兼容的版本。我之前遇到了兼容性问题。当我从 Tortoise 签入一个文件时,我无法从 Eclipse 签出该文件。

采纳答案by Michael Dillon

SVN ignores UNIX file permissions when commiting. The way that you set exec permissions on a file is to change the svn properties for that file. If you are on Windows, the easy way to do this is to install Tortoise SVN. Then after you have committed, use Tortoise to open the repo-browser. Find a file that needs to be executable and right-click it to open properties.

SVN 在提交时忽略 UNIX 文件权限。在文件上设置 exec 权限的方法是更改​​该文件的 svn 属性。如果您在 Windows 上,最简单的方法是安装 Tortoise SVN。然后在你提交之后,使用 Tortoise 打开 repo-browser。找到一个需要可执行的文件,然后右键单击它以打开属性。

The dialog that appears is the SVN properties dialog. Click New to add a new property, select svn:executable from the dropdown list, and set the property value to *.

出现的对话框是 SVN 属性对话框。点击New添加一个新的属性,在下拉列表中选择svn:executable,将属性值设置为*。

That's it. When you click OK, it is committed to the SVN repo. The next time you, or the build machine, do an svn update, that file will have executable permissions on Unix/Linux.

就是这样。单击“确定”后,它将提交到 SVN 存储库。下次您或构建机器执行 时svn update,该文件将在 Unix/Linux 上具有可执行权限。

回答by vinnyjames

svn propset svn:executable "*" someScript

svn propset svn:executable "*" someScript

The syntax is propset key valueso svn:executableis the key and "*"is the value

语法propset key value所以svn:executable是关键,"*"是值

someScriptis the filename

someScript是文件名