! [rejected] master -> master (non-fast-forward)error: failed to push some refs to
에러 내용
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/JEONGHWANMIN/react-expressApi'
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.
.gitignore , README.md 파일로 인해서 생기는 오류
해결법
1. 올리려는 브런치 앞에서 +를 붙여주면 된다.
git push origin +master
2. git pull origin master 로 업데이트 해주고 push해도 잘 올라간다.
"아마 readme 파일을 github 홈페이지에서 만들고 로컬로 업데이트 안된 상태에서
push로 데이터를 넣으려다 보니까 생겼던 문제 같음 "
2번 방식으로 해결하는게 바람직함
github 폴더 화살표 표시로 떠서 클릭 안되는 현상 해결법
git init한 파일안에 또 git init된 경우 발생하는 에러현상
하위 폴더 git 연결을 끊어주면 된다.
rm -rf .git //.git 파일 제거
git rm --cached . -rf //스테이지의 파일을 제거
warning: LF will be replaced by CRLF in frontend/.gitignore.
The file will have its original line endings in your working directory
Linux , Unix , mac , Windows 등 다른 운영체제로 git 작업할때 발생하는 현 상이라고 합니다.
git이 어느거에 맞출지를 모른다..
해결법
// windows
git config --global core.autocrlf true
// linux or mac
git config --global core.autocrlf true input
// error off
git config --global core.safecrlf false
Ref : https://blog.jaeyoon.io/2018/01/git-crlf.html
'Git' 카테고리의 다른 글
[Git] 명령어 모음 (0) | 2022.02.25 |
---|