본문 바로가기
TIL/Git

Git | error: failed to push some refs to

by 홍차23 2020. 12. 11.

git init

git add .

git commit -m "first commit"

git remote add origin http://~.git

git push -u origin main

>>error: failed to push some refs to 'http://~git'

 

git add .

git commit -m "test"

git push

>>fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

 

git push --set-upstream origin master //master 브랜치 생성 

>>* [new branch]      master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

 

 

'TIL > Git' 카테고리의 다른 글

Git | branch conflict 해결하기  (0) 2020.11.23
Git | revert  (0) 2020.10.15
Git | fatal: No such remote  (0) 2020.10.15
Git | fatal: remote origin already exists  (0) 2020.10.15

댓글