IT/실수하지말자

[Error] git의 다양한 에러들

Terriermon 2021. 12. 14. 14:50

Gitbash

 

1. 로그인 오류

remote: HTTP Basic: Access denied

- git bash에서 처음 설정할 때, 계정의 email(username) / 비밀번호를 잘못 설정 한 것

 

 

해결방법

https://goodteacher.tistory.com/88

git config --system --unset credential.helper

위 명령어를 입력하면 email(username)과 비밀번호를 입력할 수 있는 창이 나타난다.

 

그러나, 지속적으로 로그인 정보를 묻기 때문에 한 가지 설정을 더 입력해야 한다.

 

git config credential.helper store

명령어 입력 후, 다시 한 번 로그인을 하면 더 이상 묻지 않는다.

 

 

 

 

2. 충돌 오류

your local changes to the following files would be overwritten by merge

- local과 저장소의 코드가 달라서 발생하는 오류

- git pull/push 할 때 종종 발생한다.

 

git status

- git status를 하게 되면 오류 상황과 고쳐야 할 파일 리스트가 나온다.

 

git add <file>

- 로컬 상태 저장

 

git restore <file>

- 저장소 코드로 local file을 변경한다.

 

git restore . 잘못 찍으면 로컬에서 개발한 것이 모두 다 날라갈 수 있으니 조심하자. ㅎ...

 

 

 

3. 그냥 실수

Expansion of alias failed; not a git command 

- git push origin develop을 dv로 단축키 설정을 한 후, 실행을 하니 나타났다.

- git config에서 직접 alais 설정을 했는데,

[alias]
	dv = git push origin develop

이렇게 "git" 명령까지 같이 있었다.

 

[alias]
	dv = push origin develop

이렇게 git 명령을 빼줘야 한다.