Git & GitHub/오류해결

Git & GitHub/오류해결

[오류해결] fatal: Unable to create '~~/.git/index.lock': File exists.

git에 이유 모를 에러가 발생해서 강제종료되었다. 그래서 다시 git을 실행하여 git add 명령어를 사용했는데 아래와 같은 에러가 발생할 때가 있을 것이다. $ git add . fatal: Unable to create '디렉토리/.git/index.lock': File exists. Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earl..

Git & GitHub/오류해결

[오류해결][Git] merge Conflict 해결

$ git merge my Auto-merging 기능.txt CONFLICT (content): Merge conflict in 기능.txt Automatic merge failed; fix conflicts and then commit the result. 한 프로젝트를 가지고 브랜치를 나눠서 서로 다른 작업을 하다보면 프로젝트 수정하는 부분이 겹칠 수도 있다. 이 때 git merge 명령어를 통해 브랜치를 합병하면 위와 같은 오류가 발생할 수 있다. Automatic merge failed; fix conflicts and then commit the result. 해석해보자면, 합병에 실패했다. 충돌되는 부분을 수정하고나서 커밋하라는 말이다. 만약 main 브랜치와 my 브랜치가 있다고 해보자...

Git & GitHub/오류해결

[오류해결] fatal: The current branch master has no upstream branch.To push the current branch and set the remote as upstream

git push 명령어를 사용했을 때 아래와 같은 에러가 발생하면 어떻게 해야할까? $ git push fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master 브랜치를 master로 언급하여 푸시해도 에러가 발생했다. $ git push origin master bash: $'\302\226git': command not found 이 에러의 원인은 원격저장소에 대한 브랜치 설정이 안되어있기 때문에 그런 것이다. 깃에서 제시해준 해결방법을 그대로 사용하면 대체로 해결이 된다. $ ..

Git & GitHub/오류해결

[Git] Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch

Git bash를 통해서 merge를 진행하거나 pull 명령어를 사용하면 # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit 라고 적힌 까만 창이 뜨는데 아무것도 적히지도 않고 esc나 q를 눌러도 나가지지 않아서 굉장히 당황스러울 것이다. 키보드를 막누르다가 잘못 건드려서 로컬저장소에 문제가 생기면 어쩌나 하는 생각도 들 것이다. 이럴 때 간단히 빠져나갈 ..

Git & GitHub/오류해결

git push 오류가 생길 때 (부제: error: failed to push some refs to)

local에는 readme파일이 없는데 원격저장소에만 있을 때 생기는 오류라고 한다. git add README.md를 시도해봤지만 도저히 되지가 않아서 깃허브에 직접 추가했었다. 그래서 로컬저장소와 원격 저장소와의 괴리가 생긴듯하다. 1. 강제로 push 하기 (주의! 원격저장소의 파일이 훼손될 수 있음) 처음 이 오류가 발생했을 때 여러 블로그를 전전하며 오류 해결방법을 찾아봤었다. 어떤 블로그에서 이 방법을 추천해줄길래 해봤었다. git push -f origin 강제로 푸시하면 문제해결이 되나 싶었더니 README.md 파일 날라가버린다. README를 잘 꾸며놓았는데 날라간다면 정말 화날 것 같으니 주의하는 게 좋겠다. 2. 추천하는 방법 - git pull 오류가 났을 때도 git pull을 ..

gakko
'Git & GitHub/오류해결' 카테고리의 글 목록