본문 바로가기
: ) Web/웹 스터디

VSCode git이랑 연결하기 / git에 올리기

by miiinn 2023. 11. 9.

**아주 간결하게 쓴 버전**

 

1. Github에서 repository 하나 만들기

 

2. VSCode에서 f1 -> git clone -> Clone from GitHub 들어가서 로그인하기

 

3. Repository 선택

 

4. 연결할 폴더 선택

 

이렇게 하면 해당 Repository와 지정한 폴더가 연결된다.


여기서 기존에 있던 파일을 올리고 싶다면 

해당 폴더 아래로 파일들을 옮기고 다음 명령어들을 이용한다.

 

1. git status : 현재 올라가지 않은 파일 확인

 

2. git add -A : 현재 안 올라간 파일 모두 추가하기

3. git commit -m "메시지" : 메시지와 함께 커밋하기

여기서 다음과 같은 오류가 난다면

Author identity unknown *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository.

잘 보면 해결 방법이 써 있다. 

>>> git config --global user.email "you@example.com"

>>> git config --global user.name "Your Name"

 

두 명령어를 통해 이메일과 이름을 지정해주고 다시 커밋을 해준다.

 

4. git push : 최종적으로 git에 올리기