DevelopmentGit

[Git] VScode에서 gitlab/github 연동하기

💡 VScode에서 github/gitlab을 사용하는 방법

1. git 설치하기

https://git-scm.com/ (다운로드 사이트)

2. VScode에서 GitLens, Git History 설치

VScode에서 확장프로그램으로 git을 검색하여 GitLens, Git History 설치

3. gitlab 이메일과 이름 설정

명령프롬프트 혹은 VScode 터미널에서 gitlab 이메일과 이름 설정
(VScode 터미널을 gitbash로 변경해줘야 했다.)

git config --global user.email "your_email@example.com"
git config --global user.name "your name"

4. 연결하고자 하는 gitlab 레포지토리 주소 복사

HTTPS 주소 복사 ex) https://gitlab.com/~
(github는 사용자 이름과 비밀번호 입력 과정이 추가로 필요하다.)

5. VScode에서 git clone 및 연결

5. 연동 성공

성공적으로 연동된 경우, 내용 변경 후 VScode 왼쪽 트리모양(source control)탭에 변경 갯수들이 활성화 된다.

6. commit

source control 탭을 클릭 후, source control 메뉴에서 commit하고자 하는 폴더를 찾아 commit 메세지를 작성하고 체크모양(commit)을 클릭한다.

7. push

source control 탭의 commits 메뉴에서 commit할 내용을 찾아 구름모양(push)를 누르면 반영된다. (github의 경우, source control 메뉴 sync changes를 누르면 된다.)

8. 추가 꿀팁!

Reference

댓글 1개

댓글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다