code

Visual Studio Code가 설치된 git을 감지 할 수 없음

codestyles 2020. 9. 23. 07:37
반응형

Visual Studio Code가 설치된 git을 감지 할 수 없음


Visual Studio Code에서 "시스템에 git이 설치되지 않은 것 같습니다."라고보고합니다. git보기로 전환하려고 할 때. 다른 git 클라이언트에서 git을 설치하고 사용하고 있음을 알고 있습니다. Visual Studio Code의 지시에 따라 git을 다시 설치하면 ( "Chocolatey로 설치하거나 git-scm.com에서 다운로드") 문제를 해결할 수 있지만 기존 git을 엉망으로 만들고 싶지는 않습니다. 내 시스템의 클라이언트. 기존 git 설치를 찾을 수 있도록 Visual Studio Code를 구성하는 안정적인 방법이 있습니까?


비주얼 스튜디오 코드는 단순히 찾습니다 PATH위한 git. 많은 UI 클라이언트는 단순성을 위해 "Portable Git"과 함께 제공 git되며 경로에 추가하지 않습니다 .

PATH찾을 수 있도록 기존 git 클라이언트를 추가하는 경우 git.exeVisual Studio Code에서 Git 소스 제어 관리를 활성화해야합니다.


이제 기존 git 설치를 사용하도록 Visual Studio Code (버전 0.10.2, 이전 버전 확인)를 구성 할 수 있습니다.

다음과 같이 Visual Studio 코드 설정 (파일-> 기본 설정-> 설정)에서 git 실행 파일의 경로를 추가하기 만하면됩니다.

{
    // Is git enabled
    "git.enabled": true,

    // Path to the git executable
    "git.path": "C:\\path\\to\\git.exe"

    // other settings
}

: 비주얼 스튜디오 코드 공개 '사용자 설정'에서 ctrl + p입력의 >sett키를 누릅니다enter

왼쪽에는 기본 설정이, 오른쪽에는 사용자 설정이 열립니다.

사용자 설정에서 git.exe에 경로를 추가하십시오.

"git.path": "C:\\Users\\[WINDOWS_USER]\\AppData\\Local\\Programs\\Git\\bin\\git.exe"

[WINDOWS_USER]를 사용자 이름으로 바꿉니다.

Visual Studio Code 다시 시작


이는 macOS를 업그레이드 한 후에 발생할 수 있습니다. 터미널에서 git을 실행하고 오류 메시지가 다음으로 시작하는지 확인하십시오.

xcrun : 오류 : 잘못된 활성 개발자 경로 (/ Library / Developer / CommandLineTools) ...

그렇다면 수정은 실행하는 것입니다.

xcode-select --install

터미널에서. 자세한 내용 이 답변 을 참조하십시오.


이전 게시물이지만 MAC/OSX이것을 눌러서 누군가에게 도움이되기를 바랍니다.

조짐:

  • 한동안 사용해 왔으며 VS Code문제가 없습니다.Git
  • 설치 XCode
  • 설치 한 후 XCode, VS Code갑자기 "망할 놈을 찾아 당신이 중 하나를 설정에서 경로를 설치하거나 설정하는 요청 수 없습니다"

빠른 수정:

XCode설치 후 처음으로 실행 하고 라이센스에 동의합니다 . 그게 다야.

이 "수정"을 우연히 발견 한 방법 :

검사 git대한 수많은 팁 ( 예 : which gitand git --version)을 살펴본 후 후자는 실제로이 터미널 메시지에 대한 단서를 제공했습니다.

Xcode / iOS 라이센스에 동의하려면 관리자 권한이 필요합니다. "sudo xcodebuild -license"를 실행 한 다음이 명령을 다시 시도하십시오.

에 관해서는 이유 XCode 도에 그것의 손을 감싸는 것 git, WAT

즐거운 연말 보내시고 즐거운 코딩 되세요 :)


MacOS High Sierra 10.13.5업그레이드 후이 문제에 직면했습니다 Xcode.

git명령을 실행하면 아래와 같은 메시지를 받았습니다.

Xcode / iOS 라이센스에 동의하려면 관리자 권한이 필요합니다. "sudo xcodebuild -license"를 실행 한 다음이 명령을 다시 시도하십시오.

실행 한 후 sudo xcodebuild -license메시지가 나타납니다 아래 명령을 :

Xcode 라이센스 계약에 동의하지 않았습니다. Xcode를 사용하려면 아래의 두 라이센스 계약에 모두 동의해야합니다.

'/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf'에서 라이센스 계약을 보려면 Enter 키를 누르십시오.

입력하면 Enter오픈 라이선스 계약 및 타이핑의 핵심 space메시지가 나타납니다 아래 때까지의 검토 세부 사항 키 :

'동의 함'을 입력하면 소프트웨어 라이센스 계약 조건에 동의하는 것입니다. 인쇄하려면 '인쇄'를 입력하고 취소하려면 [동의, 인쇄, 취소]를 입력하십시오.

마지막 단계는 단순히 입력 agree하여 라이센스 계약에 서명하는 것입니다.


git명령어를 입력 한 후 VSCode가 git을 다시 감지했는지 확인할 수 있습니다.


여러 환경이있는 경우. VS Code 작업 공간 설정 에 Git 경로를 포함 할 수 있습니다 . Windows의 경우 설정에 따라 Ctlr + P를 누르고 "설정"을 검색 있습니다. setting.json (또는 File> Preferences> Settings)을 엽니 다. 작업 공간 설정으로 이동 합니다 . "경로"를 찾아 Git bin 및 cmd 폴더에 경로를 추가합니다.

여기에 이미지 설명 입력

여기에 이미지 설명 입력

여기에 이미지 설명 입력

여기에 이미지 설명 입력

환경에는 자체 경로가있을 수 있습니다. 가능한 경우 cmd, git bin 및 cmd 경로에서 내 PC % PATH %를 에코했지만 프로젝트에서 작업 할 때 에코 % PATH %에 git 및 cmd 폴더가 없습니다. 위와 같이 추가하면 문제가 해결되었습니다.

추가 참고 사항 :

cmd에서 "% PATH %"를 에코하고 git bin 및 cmd 폴더가 포함되어 있는지 확인할 수 있습니다. 그렇지 않은 경우 SETX PATH를 사용하여 연결할 수 있습니다.

SETX PATH "%PATH%;Path_to_Git_bin;Path_to_Gt_cmd;"

This will make git available on local root but not on some environments which comes with their own paths(SETX /M PATH "%PATH%;Path_to_Git_bin;Path_to_Gt_cmd;" would have though).

In case you have a long Path that is chopped off dues to Path length(getting "Error: Truncated at X characters." message), you can increase the path length on regedit.

  • On "Search Windows", search for "regedit". Right-click to open as Admin.
  • Go to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  • Right-click and modify. Change value data from 0 to 1

This will increase your path length. If it is already one, then I am not sure how to proceed from there :).

[여기에 이미지 설명 입력6 [여기에 이미지 설명 입력]6


i have recently start visual studio code and have this issue and just write the exact path of executable git solve the issue .... here is the code ...

"git.path": "C:\Program Files\Git\bin\git.exe",


After an OSX update i had to run xcode-select --install for the gitlens to work


First check if Git* installed or not in your system

by typing the command in cmd /command prompt (In windows)

where git

if you get an output like this

λ where git
C:\cmder\vendor\git-for-windows\cmd\git.exe

Then Go to Settings > Preferences > Settings and put the bellow code** right part.

 {
    // If git enabled ?
    "git.enabled": true,

    // Path to the git executable
    "git.path": "C:\\cmder\\vendor\\git-for-windows\\cmd\\git.exe"
}

** Just add double slash (\\) just like the above code.


The only way I could get to work in my Windows 8.1 is the following: Add to system environment variables (not user variables):

c:\Users\USERNAME\AppData\Local\GitHub\PortableGit_YOURVERSION\bin\;c:\Users\USERNAME\AppData\Local\GitHub\PortableGit_YOURVERSION\libexec\git-core\;c:\Users\USERNAME\AppData\Local\GitHub\PortableGit_YOURVERSION\cmd\

This fixed the "it looks like git is not installed on your system" error on my Visual Studio Code.


Three years later, I ran into the same issue. Setting the path in user settings & PATH environment variable didn't help. I updated VSCode and that solved it.


버전 관리

First install Git onto your desktop, then Add the encircled extension in vscode, as seen in the picture.

That helped me fix the same issue you have.


I found that i had git: false in settings.json. Changed it to true and works now.

참고URL : https://stackoverflow.com/questions/29971624/visual-studio-code-cannot-detect-installed-git

반응형