git troubleshooting
git 사용하면서 발생하는 문제들의 해결 방안 모음 ( git tips 문서도 참고)
git 사용중 발생하는 에러 유형 및 처리 모음
- git clone 시 repository URL 이 SSL(https) 일 경우 cloning 실패 해결 방법
- git clone 시 에러 - fatal: early EOF fatal: index-pack failed
- git pull error: Your local changes to the following files would be overwritten by merge:
- git pull 실패 - You have not concluded your merge (MERGE_HEAD exists)
- git push ERROR: Repository not found 에러 처리
- git 에서 https repository 연결시 SSL 인증서 오류 해결법
- git 에서 https 로 연결시 "error: Protocol https not supported or disabled in libcurl while accessing https://github.com/" 에러 처리
- How to discard local commits in git - “Your branch is ahead of 'repo/branch' by N commits”?
- 터미널에서 git push 시 Gtk-WARNING 에러 발생
git push 시 "No refs in common and none specified; doing nothing. Perhaps you should specify a branch such as 'master'."
git push origin master
Git push error '[remote rejected] master -> master (branch is currently checked out)'
Counting objects: 13, done. Delta compression using up to 8 threads. Compressing objects: 100% (10/10), done. Writing objects: 100% (13/13), 2.89 KiB | 0 bytes/s, done. Total 13 (delta 3), reused 0 (delta 0) remote: error: refusing to update checked out branch: refs/heads/master remote: error: By default, updating the current branch in a non-bare repository remote: error: is denied, because it will make the index and work tree inconsist ent remote: error: with what you pushed, and will require 'git reset --hard' to matc h remote: error: the work tree to HEAD. remote: error: remote: error: You can set 'receive.denyCurrentBranch' configuration variable to remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into remote: error: its current branch; however, this is not recommended unless you remote: error: arranged to update its work tree to match what you pushed in some remote: error: other way. remote: error: remote: error: To squelch this message and still keep the default behaviour, set remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
remote repository 를 bare repository 로 만들어야 함.
remote repository 에서 다음 명령어 실행
## repository 로 이동 cd /var/lib/git/myproj.git git config --bool core.bare true ## 그리고 .git 을 제외하고 remote repository 의 모든 파일 삭제
client 에서 실행
git push
Git push: fatal: The current branch master has multiple upstream branches, refusing to push
git config remote.origin.push HEAD
- http://stackoverflow.com/questions/17096311/why-do-i-need-to-explicitly-push-a-new-branch
- http://stackoverflow.com/questions/13030714/git-1-8-0-fatal-the-current-branch-master-has-multiple-upstream-branches-refu
Git pull: You asked me to pull without telling me which branch you want to merge with, and 'branch.master.merge' in your configuration file does not tell me, either.
.git/config 파일에 다음 내용 추가
[branch "master"]
remote = origin
merge = refs/heads/master