git 在 Webstorm 8 上清除只读状态
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25396984/
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
Getting Clear read only status on Webstorm 8
提问by Mozak
I am new to Webstorm 8. I have webstorm 8 installed on Ubuntu 14.04 LTS.
我是 Webstorm 8 的新手。我在 Ubuntu 14.04 LTS 上安装了 webstorm 8。
I am trying to edit a file but I am getting a popup, with heading "Clear read only status", which shows file and two radio button
我正在尝试编辑文件,但出现一个弹出窗口,标题为“清除只读状态”,其中显示文件和两个单选按钮
- Using File System
- Using version control integration
- 使用文件系统
- 使用版本控制集成
When I select Using File system and click OK, nothing happens, and it doesn't allow to select Second option.
当我选择使用文件系统并单击确定时,没有任何反应,并且不允许选择第二个选项。
I am using git as my dcvs.
我使用 git 作为我的 dcvs。
Please guide me on how I can remove this read only status from that file.
请指导我如何从该文件中删除此只读状态。
Thanks in advance.
提前致谢。
回答by Raheel
I had similar problem and I ran following command and my problem was resolved:
我遇到了类似的问题,我运行了以下命令,我的问题得到了解决:
sudo chown -R myusername my-project-folder
sudo chown -R myusername my-project-folder
Works on both Ubuntu & OS X
适用于 Ubuntu 和 OS X
To check username use: whoami
检查用户名使用:whoami
回答by VonC
When I select Using File system and click OK, nothing happens
当我选择使用文件系统并单击确定时,没有任何反应
Nothing visiblehappen, but you should be able to edit your file, since the file should now be in 755 mode (as opposed to 644)
没有任何可见的事情发生,但您应该能够编辑您的文件,因为文件现在应该处于 755 模式(而不是 644)
More generally, check your umask
: it should be 0022, which means a git clone would by default create 644 files (writable), as detailed in "why my file permission being changed after pull from git repository".
更一般地说,检查您的umask
: 它应该是 0022,这意味着 git clone 将默认创建 644 个文件(可写),如“为什么我的文件权限在从 git 存储库拉取后更改”中详述。
it doesn't allow to select Second option.
它不允许选择第二个选项。
That may be because the sources edited in Webstorm aren't in a git repo.
这可能是因为在 Webstorm 中编辑的源代码不在 git repo 中。
回答by Mihai
Same answer as above but use the current user and also add the files to the current group
与上述相同的答案,但使用当前用户并将文件添加到当前组
sudo chown -R $USER:$USER my-project-folder
$USER is a variable which stores your currently logged in user,at least on Ubuntu.
$USER 是一个变量,用于存储您当前登录的用户,至少在 Ubuntu 上是这样。