简体   繁体   English

将 git 设置为版本控制时,RStudio 给出“功能不正确”

[英]RStudio gives "Incorrect function" when setting git as Version control

When I create a new project and select to create a new Git repository, or when I try to change the version control system in project options I receive a RStudio error stating "Incorrect function" with a big X and no extra information.当我创建一个新项目和 select 以创建一个新的 Git 存储库时,或者当我尝试在项目选项中更改版本控制系统时,我收到一个 RStudio 并没有额外的错误信息说明“函数不正确”。

The below link has a similar issue, but their solution of changing the path for git.exe has not helped (i have tried all three paths)下面的链接有类似的问题,但他们更改 git.exe 路径的解决方案没有帮助(我已经尝试了所有三个路径)

https://support.rstudio.com/hc/en-us/community/posts/200632528-Git-Error-Incorrect-Function https://support.rstudio.com/hc/en-us/community/posts/200632528-Git-Error-Incorrect-Function

Some extra notes:一些额外的说明:

  • RStudio allows me to clone repository to set new working directory RStudio 允许我克隆存储库以设置新的工作目录
  • Also git works in bash, so i feel this is an RStudio issue. git 也适用于 bash,所以我觉得这是一个 RStudio 问题。

I encountered the same error. 我遇到了同样的错误。 For me it also had to do with using a network path not a local directory for the project location (as for lewis1211). 对我来说,它也与使用网络路径而不是项目位置的本地目录有关(对于lewis1211)。

Workaround: Map the network drive. 解决方法:映射网络驱动器。 Eg Map your //server/share to some drive, say Z: (using map network drive, if you are using windows). 例如,将你的//服务器/共享映射到某个驱动器,比如Z :(使用地图网络驱动器,如果你使用的是Windows)。 If you set your project up under Z: then, it works. 如果您在Z下设置项目:那么,它可以工作。

If you have already chosen "git.exe" in RStudio --> Tools --> Global Options --> Git/SVN , then try to open Rstudio shell and type git init . 如果你已经在RStudio --> Tools --> Global Options --> Git/SVN选择了"git.exe" ,那么尝试打开Rstudio shell并输入git init In my case it showed "Permission denied", and after running as administrator the problem has gone. 在我的情况下,它显示“权限被拒绝”,并以管理员身份运行后问题已经消失。

This is only a partial answer if it fixes your problem: I reproduced this when trying to use a network path for a project location. 如果它解决了您的问题,这只是部分答案:我在尝试使用项目位置的网络路径时重现了这一点。 When using a local directory no error occurs. 使用本地目录时不会发生错误。 Could indeed be an RStudio issue. 确实可能是一个RStudio问题。

Run you R studio as Project administration. 让你R工作室作为项目管理。 This solves my issue. 这解决了我的问题。

I have the same problem.我也有同样的问题。 The Git-RStudio-Connection fails but git is working perfectly in the CMD. Git-RStudio-Connection失败,但 git 在 CMD 中运行良好。 When running the git init command in CMD it works and creates a .git folder.在 CMD 中运行git init命令时,它可以工作并创建一个.git文件夹。 But running the git init command in the RStudio terminal fails with a message Warning: unable to access 'C:/Users/%username%/.gitconfig': Permission denied ... fatal: unknown error occured while reading the configuration files .但是在 RStudio 终端中运行git init命令失败并显示消息Warning: unable to access 'C:/Users/%username%/.gitconfig': Permission denied ... fatal: unknown error occured while reading the configuration files

The Version Control Sytem (VCS) or git-Panel does not appear in RStudio and selecting it in the projects options leads to the same message Error: Unzulässige Function (eng. Error: Incorrect function ).版本控制系统 (VCS)或 git-Panel 未出现在 RStudio 中并在项目选项中选择它会导致相同的消息Error: Unzulässige Function (英文Error: Incorrect function

A closer look into the .gitconfig file should give you a new solution approach hopefully without having administration rights.仔细查看.gitconfig文件应该会为您提供一种新的解决方案方法,希望您无需拥有管理权限。 Comparing the installation on the integration worksation with a productive workstation shows, that on the Test-Machine an incomplete.gitconfig file is on C:/Users/%username%/.gitconfig and on the Productive-Machine a complete gitconfig file is on Z:/.gitconfig .将集成工作站上的安装与生产工作站进行比较表明,在测试机器上,一个不完整的.gitconfig 文件位于C:/Users/%username%/.gitconfig上,而在生产机器上,一个完整的 gitconfig 文件位于Z:/.gitconfig By the way, Z is a mapped drive which is linking to the company's user-profile settings (see CMD > echo %HOMEDRIVE% ).顺便说一句,Z 是一个映射驱动器,它链接到公司的用户配置文件设置(请参阅CMD > echo %HOMEDRIVE% )。

According to this analysis there should be 2 possible solutions: (1) delete the .gitconfig and hope the the system is correctly looking into your profiles directory (2) complete the .gitconfig file that all necessary information are there.根据此分析,应该有两种可能的解决方案:(1)删除.gitconfig并希望系统正确查看您的配置文件目录(2)完成所有必要信息的.gitconfig文件。 The message fatal: unknown error occured while reading the configuration files could actually be a hint, that the first message access... permission denied is false and the problem lies in the incomplete file.消息fatal: unknown error occured while reading the configuration files实际上可能是一个提示,第一条消息access... permission denied是错误的,问题在于文件不完整。

[user]
    name = DOE John 
    email = john.doe@acme.com
[merge]
    tool = kdiff3
[mergetool "kdiff3"]
    path = C:/Program Files/KDiff3/kdiff3.exe
[diff]
    guitool = kdiff3
[difftool "kdiff3"]
    path = C:/Program Files/KDiff3/kdiff3.exe
[core]
    editor = \"C:/Program Files (x86)/GitExtensions/GitExtensions.exe\" fileeditor

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

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