1. GitHub

이준용·2023년 2월 1일
1

Study

목록 보기
1/5
post-thumbnail
  1. github 환경세팅
  2. repository 생성
  3. repository 제거
  4. git.com에 저장된 repository를 컴퓨터로 가져오기
  5. commit

1. github 환경세팅

· github.com에 내 컴퓨터에서 push를 하려면 올려주는 클라이언트가 필요함 그 방법으로 git bash를 써도 되고 vscode에 내장된 클라이언트를 써도 됨

0) github.com repository생성

우선 github에서 reposiory를 만든다.

1) vscode로 github에 올리는법

vscode 터미널 열기(ctrl+`)
· +버튼 오른쪽 칸 누르고 select default profile
· gitbash 클릭하면 power shell에서 bash로 변경됨
· +버튼 클릭

$ ssh-keygen
$ ls -al 경로

id_rsa (비밀키)
id_rsa.pub (공개키)
두개의 파일이 생성됨

$ cat 경로+id_rsa.pub # id_rsa.pub의 내용확인

· id_rsa.pub 공개키를 github에 등록하면
내 컴퓨터에 있는 비밀키와 조합하여 인증함(rsa방식)
· github.com의 setting에는 repository와 global setting이 있는데 이 공개키를 repository에 등록한다면 그 저장소에만 접근이 가능함
·add key하면 컴퓨터 인증가능

2) git.com에서 repository 가져오기(복사해오기)

· github.com에서 repository의 ssh주소를 복사
· vscode에서 clone repository(파일에서여나 source control에서 여나 똑같음)

3) git graph

vscode내에 extensions에서 git graph설치한다면 버전관리에 대한 gui화 가능

4) commiter 설정

코드작성자가 누구인지 설정할 수 있음 협업시 --global 대신 repository로 설정할 수 있음

$ git config --global user.name '{이름}'
$ git config --global user.email '{이메일}'
profile
배고파

0개의 댓글