$ rm -rf .git
$ git init
$ git add .
$ git commit -m "first project commit"
$ git remote -v
$ git remote rm origin
$ git remote add origin [url]
$ git push -u --force origin main
GitHub 에서 2020년 10월을 기준으로 신규 레포지토리를 생성시 디폴트 브랜치 명이 main으로 생성됨.
https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main/
하나의 branch만 사용하고 싶으면
vscode에선 master가 기본 branch라 branch명을 변경후 push
$ git branch -M [되고싶은 branch name]
$ git branch -m [현재 branch name] [바꾸고싶은 branch name]
$ git pull origin [branch name]
$ git pull
$ git push -u origin main
[참고]
https://kkangsg.tistory.com/83
https://velog.io/@jinne808/git-%EB%82%B4%EA%B0%80-%EB%B3%B4%EB%A0%A4%EA%B3%A0-%EC%A0%95%EB%A6%AC%ED%95%98%EB%8A%94-git-%EB%AA%85%EB%A0%B9%EC%96%B4