TIL/Git

Git | error: failed to push some refs to

홍차23 2020. 12. 11. 16:03

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'.