로컬에서 github 첫 연동

기역의궁전·2021년 6월 1일

처음 로컬에서 github 레포지토리 생성 시,
github에 나와 있는 순서대로 하면,

$ git branch -M main
error: refname refs/heads/master not found
fatal: Branch rename failed

위와 같은 에러가 나올 때!

아래 순서 대로 한다.

$ git init
$ git config --global user.name ‘your name here’
$ git config --global user.email ‘your email here’
$ git add .
$ git commit -m ‘first commit’
create new repository in github and copy ssh link
$ git remote add origin ‘ssh link copied above
$ git push -u origin master

0개의 댓글