일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- oracle
- ora-01722
- Oracle 18c HR schema
- 무료 오라클 데이터베이스
- Oracle 초기 사용자
- 오라클 캐릭터셋 조회
- Oracle 윈도우 설치
- 서평단
- ORA-00922
- Oracle Express Edition
- 비전공자를 위한 데이터베이스 입문
- oracle 18c
- Orace 18c
- Oracle 테이블 대소문자
- Oracle 18c HR
- Oracle 사용자명 입력
- ORA-12899
- 윈도우 Oracle
- 오라클 캐릭터셋 확인
- 무료 오라클 설치
- Oracle 18c 설치
- Oracle 사용자명
- Oracle 테이블 띄어쓰기
- 오라클 캐릭터셋 변경
Archives
- Today
- Total
The Nirsa Way
[GitHub] 깃허브 git push "error: failed to push some refs to" 에러 해결 방법 본문
CI CD/GitHub
[GitHub] 깃허브 git push "error: failed to push some refs to" 에러 해결 방법
KoreaNirsa 2020. 3. 19. 14:29반응형
-
Git Push "error: failed to push some refs to" 에러 해결 방법
git push 할 때 아래와 같은 에러가 발생할 수 있습니다. 해당 에러는 github에 있는 파일과 현재 push 하려는 commit이 일치하지 않아 발생 합니다.
아래 이미지와 같은 상황일 때 github에는 README.md와 git-test.txt 파일이 있지만, Local에는 git-test.txt 파일이 없어서 파일 손실 우려로 인해 git에서 에러를 내뱉는 것 입니다.
저의 경우 아래와 같이 git clone으로 원본 파일을 가져오고, 누락된 git-test.txt 파일을 작업 디렉토리로 가져온 후 생성된 프로젝트 파일 삭제하여 push에 성공 하였습니다.
git push -f origin master와 같이 강제로 덮어 씌울 수 있으나, 파일 손실의 위험이 있습니다.
[root@docker-control devops]# git clone https://github.com/islandtim/Nirsa-Project.git
Cloning into 'Nirsa-Project'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 9 (delta 1), reused 5 (delta 0), pack-reused 0
Unpacking objects: 100% (9/9), done.
[root@docker-control devops]# mv Nirsa-Project/git-test.txt ./
[root@docker-control devops]# ls -lh
total 8.0K
drwxr-xr-x. 2 root root 23 Mar 19 05:08 error_test
-rw-r--r--. 1 root root 5 Mar 19 05:24 git-test.txt
drwxr-xr-x. 3 root root 35 Mar 19 05:24 Nirsa-Project
-rw-r--r--. 1 root root 16 Mar 19 04:39 README.md
drwxr-xr-x. 2 root root 24 Mar 19 05:08 worker
[root@docker-control devops]# rm -rf Nirsa-Project/
[root@docker-control devops]# ls -lh
total 8.0K
drwxr-xr-x. 2 root root 23 Mar 19 05:08 error_test
-rw-r--r--. 1 root root 5 Mar 19 05:24 git-test.txt
-rw-r--r--. 1 root root 16 Mar 19 04:39 README.md
drwxr-xr-x. 2 root root 24 Mar 19 05:08 worker
[root@docker-control devops]#
[root@docker-control devops]# git add *
[root@docker-control devops]# git commit -m "error"
[master (root-commit) 4e6358a] error
Committer: root <root@docker-control.asia-northeast3-a.c.docker-project-271503.internal>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
- Push 에러 발생 시 github
- Push 에러 해결 후 github
반응형
'CI CD > GitHub' 카테고리의 다른 글
[GitHub] 잘못 올린 API Key/Secret Key 문자열만 제거하기(git-filter-repo) (3) | 2025.08.08 |
---|---|
[GitHub] 깃허브 사용법-3 (디렉토리 또는 파일 삭제, git rm) (1) | 2020.03.19 |
[GitHub] 깃허브 사용법-2 (init, remote add, add, commit, pull, push) (0) | 2020.03.19 |
[GitHub] 깃허브 사용법-1 (프로젝트 생성) (1) | 2020.03.19 |