1. Git Error Fix 1: error : The following untracked working tree files would be overwritten by merge

error : The following untracked working tree files would be overwritten by merge 는 “git add .”하고 “git stash” 후 “git pull”을 한다.

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

Please move or remove them before you merge
Aborting

// untracked files이 있다는 메세지이므로 git add로 파일 추가를 해준 후 git stash로 로컬 임시 저장 후 git pull을 해 준다.

git add .
git stash
git pull

2. Git Error Fix 2: error: You have not concluded your merge (MERGE_HEAD exists)

error: You have not concluded your merge (MERGE_HEAD exists)의 경우 “git commit -m “메세지”로 커밋을 완료 후 git pull 해준다.

error: You have not concluded your merge (MERGE_HEAD exists).
hint: Please, commit your changes before merging.
fatal: Exiting because of unfinished merge.

// conflict 파일 머지 이후 커밋이 제대로 되지 않은 경우 발생. commit -m 으로 커밋을 완료해준다.

git commit -m "merge"
git pull

3. Git Error Fix 3: error: failed to push some refs to ‘https://github.com/.git’

error: failed to push some refs to ‘https://’ 의 경우 “git pull”을 먼저 하고 “git push” 한다.

error: failed to push some refs to 'https://github.com/.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

// 원격 저장소와 로컬 저장소 간의 상태가 달라서 나오는 에러. 
// 원격 저장소의 변경사항을 먼저 내려받은 후 다시 push를 해준다.

git pull
git push


Leave a Reply

Your email address will not be published. Required fields are marked *