git hub

[git hub] repositoriy 새로 등록해 주기

녕지 2022. 2. 15. 21:31
$ git push -u origin master
To https://github.com/cremecoc/javaExample.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/내깃허브닉넴/javaExample.git'

 

레퍼지토리를 나누어 주고 싶어서 새로운 파일에서 push 했더니 새롭게 생성한 레퍼지토리와 연결이 안 되어 위와 같은 오류가 떴다

 

해결 방법

1. 새롭게 생성한 레퍼지토리를 추가해 준다

$ git remote add hj https://github.com/내깃헙닉넴/HTML.git

 

2. 1번에서 등록한 레퍼지토리에 push해 준다

$ git push -u hj main