programing

Windows용 Git Credential Manager를 비활성화하려면 어떻게 해야 합니까?

bestprogram 2023. 5. 17. 23:35

Windows용 Git Credential Manager를 비활성화하려면 어떻게 해야 합니까?

Git의 최신 버전에서는 Bash 프롬프트에서 매번 암호를 묻는 대신 "Git Credential Manager for Windows" 대화 상자가 팝업됩니다.

저는 이런 행동이 정말 싫어요.어떻게 하면 매번 Bash 셸에서 암호를 입력할 수 있습니까?

참고로 Windows 자격 증명을 사용하든 내부 데몬을 사용하든 Git가 내 자격 증명을 캐시하는 것을 원하지 않습니다.모든 자격 증명 캐싱을 사용하지 않도록 설정합니다.

좋습니다. Git for 윈도우즈 설치 관리자 중에 "Git Credential Manager" 확인란을 선택하지 않거나 (설치 후) Bash 셸을 관리자로 실행하여 사용해야 합니다.git config --edit --system제하기위를 helper = manager더 이상 자격 증명 도우미로 등록되지 않도록 설정합니다.

보스포의경사용우트를 합니다.git config --edit --global 삽입 삽입및:

[core]
    askpass =

OpenSSH 자격 증명 팝업도 사용하지 않도록 설정합니다.

제거 옵션을 사용하여 Git Credential Manager for 윈도우즈를 제거할 수 있었습니다.

git-credential-manager.exe uninstall

은 이명실위에서 합니다.C:\Program Files\Git\mingw64\libexec\git-core

VSTS와 함께 사용해야 했던 또 다른 옵션:

git config --global credential.modalprompt false

제겐 효과가 없었어요

C:\Program Files\Git\mingw64\libexec\git-core
git-credential-manager.exe uninstall

Looking for Git installation(s)...
  C:\Program Files\Git

Updated your /etc/gitconfig [git config --system]
Updated your ~/.gitconfig [git config --global]

Removing from 'C:\Program Files\Git'.
  removal failed. U_U

Press any key to continue...

하지만 그것과 함께.--force작동한 플래그:

C:\Program Files\Git\mingw64\libexec\git-core
git credential-manager uninstall --force
08:21:42.537616 exec_cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
e
08:21:42.538616 git.c:576               trace: exec: git-credential-manager uninstall --force
08:21:42.538616 run-command.c:640       trace: run_command: git-credential-manager uninstall --force

Looking for Git installation(s)...
  C:\Program Files\Git

Updated your /etc/gitconfig [git config --system]
Updated your ~/.gitconfig [git config --global]


Success! Git Credential Manager for Windows was removed! ^_^

Press any key to continue...

내가 실행한 후에 그 흔적을 볼 수 있었습니다.

set git_trace=1

또한 Git 사용자 이름을 추가했습니다.

git config --global credential.username myGitUsername

그러면:

C:\Program Files\Git\mingw64\libexec\git-core
git config --global credential.helper manager

마지막으로 다음 명령을 입력합니다.

git config --global credential.modalPrompt false

SSH 에이전트가 실행 중인지 확인합니다.

  • 이 명령을 실행하려면 Bash 창을 엽니다.
eval "$(ssh-agent -s)"

그런 다음 컴퓨터 사용자/yourName 폴더(여기서 .ssh)에서 연결을 추가합니다(아직 Bash에 있음).

ssh-add .ssh/id_rsa

또는

ssh-add ~/.ssh/id_rsa (if you are not in that folder)

위에 추가한 모든 설정을 확인했습니다.

C:\Program Files\Git\mingw64\libexec\git-core
git config --list
09:41:28.915183 exec_cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-cor
e
09:41:28.917182 git.c:344               trace: built-in: git config --list
09:41:28.918181 run-command.c:640       trace: run_command: unset GIT_PAGER_IN_USE; LESS=FRX LV=-c less
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
credential.helper=manager
credential.modalprompt=false
credential.username=myGitUsername

그리고 내가 했을 때git push이번에도 처음으로 사용자 이름과 비밀번호를 추가해야 했습니다.

git push
Please enter your GitHub credentials for https://myGithubUsername@github.com/
username: myGithubUsername
password: *************
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 316 bytes | 316.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.

이후로 그이로사용을 사용합니다.git pushGit 자격 증명을 입력하라는 메시지가 더 이상 없습니다.

D:\projects\react-redux\myProject (master -> origin) (budget@1.0.0)
λ git push
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 314 bytes | 314.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/myGitUsername/myProject.git
   8d38b18..f442d74  master -> master

이러한 설정 후 다음과 같은 메시지가 포함된 이메일도 받았습니다.

A personal access token (git: https://myGitHubUsername@github.com/
on LAP0110 at 25-Jun-2018 09:22) with gist and repo scopes was recently added
to your account. Visit https://github.com/settings/tokens for more information.

일반적인 사용을 위해 자격 증명 관리자를 사용하고 싶었지만, 어떤 프롬프트도 원하지 않는 스크립트가 있습니다.git.exe스크립트에서 Git를 호출하는 방법은 다음과 같습니다.

set GIT_TERMINAL_PROMPT=0
git -c core.askpass= -c credential.helper= <command> ...

이런 방식으로 스크립트는 구성을 조정할 필요 없이 항상 "올바른" 프롬프트 없음 설정을 확인합니다.

(Windows 2.13.3용 Git)


또한 유용할 수 있는 변형은 다음과 같습니다.

set GCM_INTERACTIVE=never
# Or: git config --global credential.interactive never

set GIT_TERMINAL_PROMPT=0
git.exe -c core.askpass= -c credential.helper=manager <command> ...

하지만 주의하세요.git.exe -c credential.interactive=never <command> ...작동하지 않습니다(아마도-cGit Credential Manager for 윈도우즈는 Git Credential Manager입니다.

이러한 방식으로 GCMfW를 사용할 수는 있지만 이는 사용자에게 절대 메시지를 표시하지 않습니다. 자격 증명만 조회하므로 대화형이 아닌 환경에서 매우 유용할 수 있습니다.

사용:

C:\Program Files\Git\mingw64\libexec\git-core                                                                       
git credential-manager uninstall --force    

이는 윈도우즈 시스템에서 작동합니다.저는 그것을 테스트했고, 그것은 저에게 효과가 있었습니다.

이전 답변의 팁으로 해결되지 않은 문제의 경우:

사용합니다

git credential-manager remove -force

저는 그 문제가 있었고 다음에서 git-credential-manager.exe 파일만 제거했습니다.

C:\Program Files\Git\mingw64\libexec\git-core

아마도 문제는 소스 트리일 것입니다.

  1. 도구 → 옵션으로 이동

  2. "[10]분마다 기본 원격에서 업데이트 확인" 선택을 취소합니다.

  3. 소스 트리를 다시 시작합니다!

JetBrain IDE(InteliJ IDEA, PphStorm, WebStorm, PyCharm, Rider, RubyMine, Android Studio 또는 Goland 등)를 사용할 때 자격 증명 관리자 UI가 나타나는 경우 다음을 수행합니다.

  1. IDE에서 File → Settings → Version ControlGit 메뉴로 이동합니다.

  2. 자격 증명 도우미 사용 사용 안 함:

    자격 증명 도우미 사용 안 함

  3. 누르는 것을 잊지 마세요.

우리는 이 문제로 어려움을 겪었습니다.Git 저장소에서 Git 사용자 이름과 암호를 요청하지 않고 코드를 복제하려고 시도하는 동안 Git 사용자 이름과 암호를 요청하지 않고 코드 복제를 시작했으며 인증 실패로 인해 최종적으로 실패했습니다.자격 증명조차 설정되지 않았으며 Git 클론이 처음 사용되었습니다.

해상도:명령을 실행하면 완벽하게 작동합니다.

git config --system --unset credential.helper

자격 증명 관리자를 제거하거나 제거하지 않으려면 https://serverfault.com/questions/544156/git-clone-fail-instead-of-prompting-for-credentials/1054253#answer-1054253 을 참조하십시오.

해당 페이지의 설명 등(동일한 웹사이트 패밀리에서 중복되는 내용을 방지하기 위해 링크됨)


TL;DR: 이제 이 기능은 자동화된 기능 위에 있습니다.bash스크립트:

# https://serverfault.com/questions/544156/git-clone-fail-instead-of-prompting-for-credentials
export GIT_TERMINAL_PROMPT=0
# next env var doesn't help...
export GIT_SSH_COMMAND='ssh -oBatchMode=yes'
# these should shut up git asking, but only partly: the X-windows-like dialog doesn't pop up no more, but ...
export GIT_ASKPASS=echo
export SSH_ASKPASS=echo
# We needed to find *THIS* to shut up the bloody git-for-windows credential manager: 
# https://stackoverflow.com/questions/37182847/how-do-i-disable-git-credential-manager-for-windows#answer-45513654
export GCM_INTERACTIVE=never

자격증 관리자의 관에 있는 마지막 못은 독특한 부분이었습니다.GCM_INTERACTIVE) 위의 Martin Ba의 답변에서:Windows용 Git Credential Manager를 비활성화하려면 어떻게 해야 합니까?

대화 상자를 방지하려면 다음을 사용합니다.git config --global credential.modalPrompt false

그러면 쿼리가 콘솔로 이동합니다.

그리고 만약 :wq가 내 경우처럼 작동하지 않는다면 ctrl+z를 사용하여 중단하고 종료하지만, 이것들은 아마도 나중에 여러 개의 백업 파일을 작동시킬 것입니다. - Adem 19:9:14

또한 Git를 관리자로 실행해야 합니다!그렇지 않으면 파일이 저장되지 않습니다.

Ubuntu 18.10(Cosmic Cuttlefish)에서도 동일한 문제에 부딪혔고, 정상적인 방법으로는 제거할 수 없었습니다.사용한git config --global --unset credential.helper그리고 그것이 효과가 있는 것처럼 보였습니다.

인증 정보 관리자를 삭제하면 됩니다.

C:\Users\<USER>\AppData\Local\Programs\Git\mingw64\libexec\git-core

"user" 폴더의 c://user에서 ".gitconfig" 파일을 확인한 다음 HTTP 및 프록시 행을 제거합니다.

비밀번호에 대해 git not prompt를 설정하는 데 또 다른 문제가 있었습니다. 이 목적으로 사용할 수 있는 다른 명령줄 트릭을 배웠습니다.

작업 중인 터미널 세션에 대한 임시 솔루션을 원하는 경우 다음과 같은 방법이 유용할 수 있습니다.

git -c credential.helper= <rest of the commands>

Visual Studio 코드: 메뉴 파일 → 기본 설정 → 구성GitHubgitAuthentication: false.저장소의 프로토콜을 https://에서 git://로 변경하고 Git에 공용 키 인증을 사용합니다.

언급URL : https://stackoverflow.com/questions/37182847/how-do-i-disable-git-credential-manager-for-windows