ygreenb
yellowgreenblue
ygreenb
전체 방문자
오늘
어제
  • TIL (130)
    • Algorithm & Data Structure (70)
      • 이론 (4)
      • 프로그래머스 (54)
      • 백준 (12)
    • JAVA (4)
    • Android Studio (9)
    • Database (1)
    • WEB (25)
      • HTML+CSS (7)
      • Javascript (5)
      • React (11)
      • Django (1)
      • Node.js (1)
    • Computer Vision (13)
    • Git (8)

블로그 메뉴

  • HOME
  • TAG
  • GITHUB

공지사항

인기 글

태그

  • greedy
  • 프로그래머스 Lv.2
  • 깃허브
  • dfs
  • stack
  • Arrays.sort()
  • Android
  • Comparator
  • sort
  • Queue
  • entrySet
  • java
  • reactjs
  • kotiln
  • BFS
  • React
  • 프로그래머스
  • 스택/큐
  • git
  • 코틀린
  • HashMap
  • DP
  • compareTo()
  • getOrDefault
  • 안드로이드
  • 백준
  • 깃
  • PriorityQueue
  • git bash
  • 해시

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
ygreenb

yellowgreenblue

Git

[Git] ! [rejected] master -> master (non-fast-forward) 해결방법

2022. 3. 10. 12:16
PS C:\Users\*\git\nwitter> git push origin master
To https://github.com/ygreenb/nwitter.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/ygreenb/nwitter.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

git에 push를 하려니까 갑자기 오류가 발생...

 

원인

.gitignore 파일이나 README.md 파일로 인해 발생

 

해결방법

push 하려고 하는 브랜치 이름 앞에 +를 붙여 push 한다.

$ git push origin +master

만약 기존에 작업한 내용이 있으면 아래의 명령어를 통해 pull을 받고 push를 진행해보자!

$ git pull origin master --allow-unrelated-histories
저작자표시 (새창열림)

'Git' 카테고리의 다른 글

[Git] 원격 저장소 연결 및 끊기 원격브랜치 갱신, 조회, 삭제  (0) 2022.06.15
[Github] 보안 취약점 알림(Dependabot alerts)  (0) 2022.02.08
[VSCode] github commit push 하기  (0) 2022.01.26
[VSCode] github 연동하기 (git clone)  (0) 2022.01.26
[eclipse] Git Author, Committer 변경방법  (1) 2020.04.24
    'Git' 카테고리의 다른 글
    • [Git] 원격 저장소 연결 및 끊기 원격브랜치 갱신, 조회, 삭제
    • [Github] 보안 취약점 알림(Dependabot alerts)
    • [VSCode] github commit push 하기
    • [VSCode] github 연동하기 (git clone)
    ygreenb
    ygreenb
    개발공부기록장

    티스토리툴바