git 명령을 찾을 수 없으며 ssh-agent를 찾을 수 없습니다.
나는 오늘 GitHub에 있었고 리포지토리의 업데이트가 뒤쳐 졌다는 것을 깨달았습니다. 업데이트 를 가져 오려고 했지만 처음부터 실패했습니다. Windows 용 GitHub에서 Git Shell을 시작할 때 두 가지 메시지를 받았습니다.
경고 : git 명령을 찾을 수 없습니다. 별칭을 만들거나 PATH에 추가하십시오.
경고 : ssh-agent를 찾을 수 없습니다.
"$ git fetch origin"을 입력하려고하면 다음과 같은 오류 메시지가 나타납니다.
용어 '$'는 cmdlet, 함수, 스크립트 파일 또는 작동 가능한 프로그램의 이름으로 인식되지 않습니다. 이름의 철자를 확인하거나 경로가 포함 된 경우 경로가 올바른지 확인하고 다시 시도하십시오.
나는 또한 $ 기호를 생략하려고 시도했지만 아무것도 변경되지 않았습니다.
나는 무슨 일이 일어나고 있는지 전혀 알지 못합니다. 마지막으로 Shell을 사용했을 때 (이번 달 초), 그렇게하지 않았습니다. PATH 환경 변수에 git.exe에 대한 경로를 추가하려고 시도했지만 작동하지 않았습니다. 아무것도 변경되지 않았습니다. 그렇게 한 후에도 컴퓨터를 다시 시작하지 않았습니다. 그게 문제입니까? 또한 SSH를 사용하도록 Git을 설정 한 적이 없습니다.
최근에 GitHub 애플리케이션을 업데이트 했으며 Git Shell 이 이제 중단 된 것 같습니다.
짧은 버전
그것을 해결하기 위해
- Git Shell 닫기
- GitHub를 열고 설치 후 작업을 수행합니다.
- Git Shell을 다시 열면 수정해야합니다.
긴 버전
이건 그냥 나에게 일어난 일이고 내가 당신을 따르도록하기 위해서
- Git 셸 열기
- GitHub 를 업데이트하라는 메시지가 표시됩니다.
- 업데이트 후 Git Shell이 열립니다.
이제 오류가 발생합니다.
git 명령을 찾을 수 없습니다. 별칭을 만들거나 PATH에 추가하십시오.
경고 : ssh-agent를 찾을 수 없습니다.
이 경우 다음을 수행하십시오.
- Git 셸 닫기
- 이제 GitHub 애플리케이션 ( Git Shell 아님)을 엽니 다 .
이것은 (정확한 버전이 확실하지 않음) 라인을 따라 무언가를 말할 것입니다.
GitHub에서 git 추출 중 ..
프로세스를 진행하고 완료되면 Git Shell을 열면 수정됩니다. 적어도 나를 위해 일했습니다.
GitHub 또는 GitShell을 다시 설치하는 것을 원하지 않거나 해당 서비스를 사용하지 않는 경우 직접 해결할 수 있습니다.
기본적으로 git.exe의 디렉토리 경로를 Windows의 PATH 환경 변수에 추가하기 만하면됩니다.
저에게는 "C : \ Program Files (x86) \ Git \ bin"경로를 추가해야했습니다. 또는 Git을 다른 디렉토리에 설치했을 수 있으므로 어디에 넣었는지 찾아야합니다.
이 모든 작업을 수행하는 방법은 http://thepracticalsysadmin.com/setting-up-git-in-windows/ 에서 찾을 수 있습니다.
시스템> 고급 시스템 설정> 고급 탭> 환경 변수 (하단).
시스템 변수 (하단 상자에서 Path
섹션으로 스크롤하여 편집합니다. git 설치가 기본 위치라고 가정하고 현재 경로 끝에 아래를 추가합니다.
;C:\Program Files (x86)\Git\cmd;
끝난.
Github destop 앱을 열고 설정-> 옵션을 클릭하여 문제를 해결했습니다. 기본 셸 선택은 PowerShell이었습니다 (갑자기 작동이 중지됨) Git Bash를 선택하고 저장 한 다음 설정을 열고-> 옵션을 선택하고 PowerShell을 다시 선택했습니다. 다음으로 GitShell을 다시 열었습니다. 다시 작동하기 시작했다
TLDR;
다음을 사용하여 사용자 %path%
변수 추가%localappdata%\GitHub\PORTAB~1\bin
긴 버전 :
Github 자체 수정 작업에 대한 Kirk의 답변을 얻을 수 없었습니다.
찾고있는 파일은 git.exe이고 Windows GitHub GUI는 로컬 사용자 앱 디렉토리에 설치되므로 찾기가 다소 어렵습니다. C:\Users\andy_000\AppData\Local\GitHub\PortableGit_ed44d00daa128db527396557813e7b68709ed0e2\bin\git.exe
이 디렉토리 는 명령 창 git.exe
에 입력하여 찾을 수 있도록 Windows 환경 경로에 있어야합니다 git
.
The best solution I've found is to open your system environmental variables (System -> Advanced -> Environmental Variables) then just add a new user variable (the top box, not the bottom, which is system variables) called Path
and set its value to %localappdata%\GitHub\PORTAB~1\bin
.
This will mean that the system %path%
variable has the full user profile path to the github bin directory just as in the example.
Attempts to append %appdata%
and %userprofile%
references directly to the system %path%
do not work as these variables are not available when the system variables are set, so the solution above sets a user %path%
variable, which does allow calls to %localappdata%
etc, and which is automatically appended to the system %path%
, giving the desired effect.
Follow the simple steps:
- Open the
gitshell
update it and then close it. - Open the
github
not thegitshell
it will extract the files auto (mean update it also). - Again open the
gitshell
.
you will see the error will finish. Hope this will help you too.
I had this problem on Windows7 with installed latest github program. I even disabled all functionalities my antivirus :)
My solution was to open as administrator program powershell ise
(from menu) and run this command:
Set-ExecutionPolicy Unrestricted
You will get dialog with question, I clicked yes. Then I closed all windows and reruned github shell without any problems.
My easy solution (for GitHub desktop users):
- Create a batch file
git.bat
:
@echo off
%LocalAppData%\GitHub\Portab~1\cmd\git.exe %*
- Move it to
C:\Windows\
folder..
That's it!! You're done!!
Note: You can also use git.bat
instead of using git.exe
directly.. It'll be useful for softwares that require you to point the git executable explicitly (like Android Studio)
Another option is to change your default shell.
Go to Tools -> Options, and change your default shell from "PowerShell" to "Git Bash" or something else.
'Programing' 카테고리의 다른 글
AngularJS를 사용한 글로벌 Ajax 오류 처리기 (0) | 2020.09.24 |
---|---|
ID에 마침표가있는 CSS 선택기 (0) | 2020.09.24 |
C #에서 런타임에 PDF 파일 만들기 (0) | 2020.09.24 |
모두 제거하는 정규식 (숫자가 아닌 OR 마침표) (0) | 2020.09.24 |
CodeIgniter (PHP)에서 오류 로깅을 수행하는 방법 (0) | 2020.09.24 |