티스토리 뷰

study/Git

Git 사용하기 - 설정 편

xoxowo 2022. 6. 2. 23:29

Git 최초 설정 

Git을 설치 후 먼저 사용하기 위하여 몇 가지 환경을 설정해야 하는데  git config 명령어로 설정 내용을 확인하고 변경할 수 있다.

 

사용자 정보 설정

$ git config --global user.name "사용자 이름"
$ git config --global user.email "이메일 주소"

사용할 편집기 설정

$ git config --global core.editor emacs

 

이후 설정한 정보를 확인을 하려면 git config --list 명령어를 실행하면 설정 내용을 확인할 수 있다.

$ git config --list
user.name=John Doe
user.email=johndoe@example.com
color.status=auto
color.branch=auto
color.interactive=auto
color.diff=auto
...

git config <key> 명령으로 Git이 특정 Key에 대해 어떤 값을 사용하는지 확인할 수 있다.

$ git config user.name
John Doe

추가로 명령어에 대한 도움말이 필요할 경우 git help <verb>를 입력하면 확인할 수 있고 Git에서도 확인 가능하다.

$ git add -h
usage: git add [<options>] [--] <pathspec>...
  -n, --dry-run dry run
  -v, --verbose be verbose
  -i, --interactive interactive picking
  -p, --patch select hunks interactively
  -e, --edit edit current diff and apply
  -f, --force allow adding otherwise ignored files
  -u, --update update tracked files
  -N, --intent-to-add record only the fact that the path will be added
later
  -A, --all add changes from all tracked and untracked files
  --ignore-removal ignore paths removed in the working tree (same
as --no-all)
  --refresh don't add, only refresh the index
  --ignore-errors just skip files which cannot be added because of
errors
  --ignore-missing check if - even missing - files are ignored in
dry run
  --chmod <(+/-)x> override the executable bit of the listed files

 


내용 참고 및 이미지 출처 - Pro Git

'study > Git' 카테고리의 다른 글

Git-remote, push, pull  (0) 2022.06.08
Git-branch  (0) 2022.06.06
Git- Staged  (0) 2022.06.05
Git - init, add, commit  (0) 2022.06.04
Git 알아보기  (0) 2022.06.02
댓글