[문제해결] Git 명령줄에서 자주 발생하는 오류와 해결방법

 

다음은 한동안 xshell을 사용하지 않은 후 git 명령줄에서 발생한 일련의 오류와 해결 방법입니다.

 다음 오류가 발생했습니다.

치명적: git 저장소(또는 상위 디렉터리)가 아님: .git

나는 일부 블로그와 정보, 해결 방법을 참고했습니다.

git init

 git push로 파일을 제출했는데 다음 오류가 발생했습니다.

fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

 해결책:

 git remote add origin 'http://git.....'
 git push -u origin master

이 오류가 발생했습니다:

 해결책:

git pull --rebase origin master

오류가 발생했습니다:

error: The following untracked working tree files would be overwritten by checkout

해결책:

git clean -d -fx

오류가 발생했습니다:

** Please tell me who you are.

Run
  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'lvyp@NEU-20190128LYP.(none)')

 해결책:

로컬 창고 생성 시 사용자 이름과 메일함을 정의하지 않았다는 의미이므로 , 이때는 오류 메시지에 따라 사용하시기 바랍니다.

git config --global user.name "follow"
git config --global user.email "[email protected]"

한 문장 더

git config --local -l

 

추천

출처blog.csdn.net/m0_69061857/article/details/132222298