VS Code에서 Git 누락 – 소스 제어 공급자 없음
방금 Visual Studio Code 1.17을 설치하고 Git 리포지토리 폴더를 열었습니다. 소스 제어 탭에 들어가면 "활성 소스 제어 공급자가 없습니다" 라는 메시지 가 표시됩니다 . Git이 VSCode에 구워 졌다고 생각했습니다!?
설상가상으로 추가 SCM 공급자를 설치하려고 할 때 Git에 대한 옵션이 없습니다. 내 힘을 되 찾는 방법!?
저에게 도움이 된 것은 설정 값 git.path
을 내 git.exe
파일 의 전체 경로로 설정하는 것 입니다. 그 후 git 로고를 볼 수있었습니다.
MacOS를 사용하고 있습니까? 최근에 Xcode를 업데이트 한 경우 git을 사용하려면 Xcode의 서비스 약관에 동의해야 할 수 있습니다.
$ sudo xcodebuild -license accept
나도 가지고 있었다. 기본 git.path 설정을 재정의하려고 시도했지만 작동하지 않았습니다. 나를 위해 그것을 고친 것처럼 보이는 것은 기존 저장소를 여는 것입니다. .. 명령 프롬프트에서 내가 생성하고 'git init'을 한 빈 폴더 만 있습니다. 그 폴더를 연 후 소스 제어 버튼을 클릭 할 수 있었고 모든 git 기능을 사용할 수 있었고 더 이상 "활성 소스 제어 공급자가 없습니다"라고 말하지 않았습니다. 또한 파일-> 폴더 닫기를 수행하면 시작 위치로 돌아갑니다. 또 다른 방법은 해당 메시지 위의 작은 "분기"버튼 ( "활성 상태가 없습니다 ...")을 클릭하고 저장소를 초기화하는 것입니다. 이 메시지는 매우 혼란 스럽습니다!
Visual Studio Code 는 통합 된 Git 소스 제어 공급자와 함께 제공됩니다. 그러나 이것이 작동하려면 Git 자체도 시스템에 설치되어야합니다. 따라서 컴퓨터에 Git 을 다운로드하고 설치하기 만하면 Visual Studio Code에서도 사용할 수 있습니다.
소스 제어판이이를 알려주지는 않지만, 아쉽게도 아무 것도 제공하지 않고 조용히 있습니다. VS Code에서 다음과 같이 알려주는 방법이 있습니다. 응용 프로그램을 시작할 때 표시되는 "환영"페이지에서 “Clone Git repository…” 링크가 있습니다. 여기를 클릭하면 VS Code에서 Git이 없음을 알려줍니다.
Git을 설치하고 Visual Studio Code를 다시 시작하면 소스 제어판 상단에 작은 Git 아이콘이 표시됩니다 (물론 리포지토리가 이미 열려 있지 않은 경우).
그러면 Git이 있고 아이콘을 클릭하여 리포지토리를 초기화하거나 기존 리포지토리를 열 수 있습니다.
프로젝트 / 폴더를 초기화 (터미널에서 git init)해야합니다. VS 코드에서 git-project로 볼 수 있습니다.
터미널을 통해 프로젝트 / 폴더에 입력하십시오.
cd ~/ImbaFolder
git init (it created .git file - the git repository)
그런 다음 VS 코드가 git 저장소임을 확인하고 작동합니다.
그래서 나는 이것을 작동시키기 위해 모든 종류의 일을 시도했습니다. 나는 "git.path": "/usr/bin/git"
git을 내 경로에 직접 추가하는 등 시도했다 . 아무것도 작동하지 않았습니다.
마지막으로 VSCode 작업 영역 설정에서 "git.enabled: false"
. 나는 그것을 사실로 바꾸었고 그것은 매력처럼 작동합니다.
이것이 도움이된다면; 최신 버전의 VS Code에서 동일한 문제에 직면했고 언급 된 모든 팁을 시도했지만 운이 없었습니다. 마지막으로 작업 공간에 폴더를 추가하고 해당 woerkspace를 저장 한 다음 repo 아이콘을 확인하면 작은 git 아이콘을 볼 수 있으며 명령 구개에서 repo를 복제 할 수도 있습니다.
이에 대한 문제를 제기하고 동일한 결과를 언급했습니다. https://github.com/Microsoft/vscode/issues/49469 에서 찾을 수 있습니다.
저에게 해결책은 (Mac에서) 코드> 설정> 사용자 설정> 확장 프로그램> Git이었습니다.
Enabled-git 활성화 여부 옆에있는 (선택 취소) 상자를 선택합니다.
나를 위해 일한 가장 간단한 단계는 다음 과 같습니다.
1. Poke의 답변에서 언급 한대로 Git을 컴퓨터에 다운로드하여 설치하십시오 .
2. VS Code를 다시 시작합니다.
3. 명령 프롬프트 (Crtl + Shift + P)를 열고 'Git : Initialize Repository'라고 쓰고 원하는 폴더를 선택합니다 (임시 폴더도 가능).
4. 마지막으로 Torvin의 대답과 같이 Git 로고가 나타나고 git 계정을 설정하고 사용을 시작하기 쉽습니다.
내 플러그인이 비활성화되어 방금 활성화했습니다.
- 확장 프로그램으로 이동 (왼쪽의 확장 아이콘 클릭),
- @builtin git에 대한 Serach,
- git 기본 내장 확장을 활성화합니다.
- 그것은 나를 위해 다시 작동하기 시작했습니다.
xcode-select --install을 시도하십시오. macOS에서 git은 XCode의 명령 줄 도구에 연결됩니다.
The reason for this problem is that Git is not initialized in the folder that you are trying VS Code to open (this is for Windows 10).
- Install Visual Studio Code from https://code.visualstudio.com/download
- Install Git from https://git-scm.com/
- Create a folder named
git
in:C:\Users\YourName\
so it will look like thisC:\Users\YourName\git
(<-- you can pick any directory) - While you are in that folder, right-click >
Git GUI Here
>Create New Repository
- In pop-up window
Browse
for the folder you just created (to initialize Git there) > clickCreate
- This will create a
.git
file in that folder - Open VS Code >
File
>Open Folder
> (select the folder you just initialized Git at)
I ran into the same problem and figured out that VSCode does not recognize git repo unless it is added to a workspace.
So, add the folder you want to be tracked via Git into a workspace and git will be enabled automatically.
I did not see the Git controls until I created a file and saved the current workspace - suddenly "Source Code Control" showed the Git Icon and I could initialize a new Git repo.
Cloning an existing repo seems to be unsupported in VS Code, and I guess that is the reason that Git controls are hidden until there is a workspace where a new repo can be initialized.
If SCM view is empty you need to install a source code provider.
Check Extensions (Ctrl+Shift+X) under View and select the SCM provider you want. Start typing @ca and you will see extensions listed. Select @category: “scm providers” to see available SCM providers.
If you don’t see Git here you need to install Git. Here’s their download page for windows. https://git-scm.com/download/win
After installing you’ll see Git Extensions for VS Code listed under Extensions view. Select it and click install on the right hand side panel that appears.
After installing the SCM remember to close and reopen VS Code.
Since i installed GIT in custom defined path, i needed to reference it inside settings.json
( F1 > settings.json > enter )
Add setting:
"git.path": "<custom path to git.exe>"
Wich in my case made it look like:
{
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"git.path": "<custom path to git.exe>"
}
Right after it worked perfectly.
I found that VScode stopped tracking after I checked out a different branch (new one). What solved it was simply:
- Closing the working folder.
- Reopening the folder.
VSC then synced with the new branch and showed the differences.
Adding another solution in case someone like me runs in to this again.
I had just setup a new node project and I was getting this. I had to create a .gitignore file and add node_modules to it and then vscode looked correct. From what I can tell it might be because there are other git repos in the my node_modules and vscode was seeing those as well. Not sure the technical reasons but that seems to have fixed it for me.
Tested in VsCode on Windows dev PC.
What worked for me was to enter Settings by hitting Ctrl + , at least on my machine and then enter the following setting: SCM.provider.AlwaysShowProviders
Then just ticked the checkbox and Git was lighting up again and I could then go to Source Control by Ctrl+shift+G.
I see that Cygwin isn't mentionned here. It happened to me and I found the solution https://github.com/Microsoft/vscode/issues/7998#issuecomment-245356777
.
If you are using Git from Cygwin.From Windows terminal, execute the following command :
> cd c:\
> md cygdrive
> cd cygdrive
> c:\ - mklink /j "c" c:\
(Assuming that git is stored in the following folder : C:\Cygwin\bin\git.exe
)
Now, restart VSCode
This panel will remain blank - by design apparently. Even after installing GIT and VS Code finding it, nothing will be shown here. No need to install other extension, as GIT extension (now) comes default with VS Code. I only install Windows GIT, which VS Code will find as long as it's in the PATH.
You need to manually add repositories to populate this window. https://code.visualstudio.com/docs/editor/versioncontrol#_git-support
"You can clone a Git repository with the Git: Clone command in the Command Palette (Ctrl+Shift+P). (edit: Type in 'git: clone' in the command box) You will be asked for the URL of the remote repository"
I hope this helps someone as there is so much confusion about this. MS should really improve how this behaves for a more consistent user experience - which they may well do at some point.
All I had to do is select a git controlled folder. This made git icon appear and looks like now it appears every time. Maybe I just had to select a folder...
If you have your Git repo opened on another machine it will not be available on the machine you are currently using. You have to close the VSCode instance on one machine before you can access your source control on another.
I just fixed this problem. I newly installed vscode and this problem occurs.
OS:ubuntu 18.04.2
On my source control tab,it shows "no source control providers registered".
Here's how I fixed this problem.
1.Edit the setting file,set the gitpath to "/usr/bin"(my git dir)
2.run "git init" command in my project folder
3.press ctrl+shift+P and run "reload window" command
And this problem is fixed.
Hope it helps.
Scenario: For MAC + issue afer installing/updating xcode
:
Can also happen when you install xcode
and yet to accept the license terms. To accept the terms, just run the below.
sudo xcodebuild -license
Post to this restart VS code & you are good to go.
I'm having the same issue as OP. My issue started when I installed a PHP autocomplete extension. I uninstalled the extension and poof, source control is back.
Hope this helps someone.
This is simple way and this way has been solved my problem :
1) Run this command on console :
sudo xcodebuild -license accept
2) Close Visual Studio Code and reopen it.
That's it.
Realizing this is an old thread, but you have to set the path to git in VS Code's settings.json
file.
{
"git.alwaysShowStagedChangesResourceGroup": true,
"git.autofetch": true,
"git.path": "D:\\program files\\Git\\bin\\git.exe"
}
None of this worked for me. Was annoyed so much that I swept cleaned my installation to see if that makes a difference. That also did not work.
What worked was
Click on View > Open View > Source Control
This will open the git view.
When the git view is shown, right click on the Icon > Click on "Keep"
Here's what worked for me:
- VS Code를 제거했습니다.
- C : \ Users \ myusername \ AppData \ Roaming \ Code를 삭제했습니다.
- 재설치 된 VS 코드
참고 URL : https://stackoverflow.com/questions/46609255/git-missing-in-vs-code-no-source-control-providers
'Development Tip' 카테고리의 다른 글
WebApi에 SSL이 필요합니까? (0) | 2020.11.14 |
---|---|
Angular 2에서 확인하는 방법 (0) | 2020.11.14 |
JavaScript 스포이드 (마우스 커서 아래의 픽셀 색상 표시) (0) | 2020.11.14 |
PHP에서 문자열의 최대 길이는 얼마입니까? (0) | 2020.11.14 |
문자열을 ASCII 바이트 배열로 이동 (0) | 2020.11.14 |