1. 깃 허브에서 레포지토리를 생성한다.
2. 깃허브에서 주소를 복사한다.
3. 깃허브와 연결하고 싶은 로컬 폴더로 와서 git bash를 열어준다.
4. git init
5. git remote add origin "복사한 레포지토리 주소"
6. git checkout main (레포지토리에서는 브랜치를 main으로 만들어주지만, git bash에서는 기본적으로 브랜치명이 master로 되어있다. 때문에 main으로 브랜치를 바꿔줘야한다.)
7. git add 파일명
8. git commit -m "커밋할 메세지"
9. git push
레포지토리에 이미 자료가 있다면,
방법 1. 빈 로컬 폴더에 clone
방법 2. remote 후 pull로 가져오기
git checkout main이 안될 때,
git remote update
'etc' 카테고리의 다른 글
[eclipse] eclipse 삭제하기 (0) | 2022.06.30 |
---|---|
[MySQL] ERROR 1064 (42000): You have an error in your SQL syntax; (0) | 2022.06.27 |
[Git] git error - fatal: not a git repository (0) | 2022.06.15 |
[Git] error: pathspec 'main' did not match any file(s) known to git 해결법 (0) | 2022.03.17 |
한 레포지토리를 여러 폴더에 클론할 때 (Git fatal: refusing to merge unrelated histores) (0) | 2021.07.24 |