가이의 다락방

git 초기 설정 본문

Study

git 초기 설정

gaiserne 2016. 7. 13. 13:43

윈도우에서 git 설정하기



1. git 사이트에서 OS에 맞는 git을 설치한다. (글을 작성하는 현재 2.9.1 버전)

https://git-scm.com/



2. git bash를 연다.



3. commit 시 보여질 이름과 메일주소를 등록한다.  (git bash)

$ git config --global user.name "name"

$ git config --global user.email "id@example.com"



4. push 기본 설정을 simple로 변경

$ git config --global push.default simple


옵션은 simple, matching 두가지가 있다.

simple : 현재 작업중인 브랜치만 push

matching : local과 remote 브랜치명이 동일한 모든 브랜치를 push


나는 브랜치 수정이 완료되면 단위별로 push를 하므로, 필요에 맞는 브랜치만 올리는 simple을 적용하였다.


5. git에 등록할 ssh-key를 생성한다. (git bash)

$  ssh-keygen



6. ssh-key 생성시 사용된 경로에서 id_rsa.pub 내용을 github 또는 gitlab에 등록한다.


완료!