git config --global user.name "KimJunHee" git config --global user.email wnsgml972@gmail.com git config --global core.editor "sublime_text -w" git config --global merge.tool vimdiff git config --global color.ui true
Global Git Config 확인하기
vi ~/.gitconfig
에서 설정을 추가하면 된다.- 아래 설정들은 Global Space로 적용된다.
[core]
precomposeunicode = true
quotepath = false
[user]
name = Kwon Young Jae
email = kyoje11@gmail.com
특정 Directory에 Git config 설정 하기
vi ~/.gitconfig
에 아래 내용을 추가한다.- Directory 위치는
~/Desktop/private
아래에 해당한다.
[includeIf "gitdir:~/Desktop/private/"]
path = .gitconfig-private
~/.gitconfig-private
파일 생성하기
vi ~/.gitconfig-private
[user]
name = nesoy
email = kyoje11@kakao.com
설정된 Config 확인하기
private Directory
에 들어가서git init
을 하면 설정된 name과 email이 반영된 것을 확인할 수 있다.
Reference
- 브랜치 생성
git checkout -b {branch} git push {remote} {branch}
- 특정 브랜치에서 내려 받기
git clone -b {branch} {remote}
- branch 삭제
git branch --delete {branch} git push {remote} :{branch}
- branch 조회
git branch -r (remote만 조회) git branch -a (로컬까지 모두 조회)
- remote 조회
git remote -v (원격 저장소 url 조회) git ls-remote (refs 조회) git remote show (remote 이름 조회)
- remote 삭제
git remote remove {remote}
- remote 추가
git remote add {remote}
git checkout {branch} -> master 아니면 브랜치 변경 git merge {branch} git push -u origin master
-u 옵션은 향후에 수정된 내용을 push 혹은 pull하기 쉽게 할 수 있도록 하는 옵션이다.
git push -u {remote} {branch}
git log git shortlog
git remote update git branch -r git checkout -t {{remote}}
아무런 옵션없이 원격 저장소의 branch를 checkout 하면 ‘detached HEAD’ 상태로 소스를 보고 변경 해볼 수도 있지만, 변경사항들은 commit, push 할 수 없으며 다른 branch로 checkout하면 사라진다.
git checkout {{remote}}
- 해당 깃 디렉토리에서 시작 -> markdown 파일
- author에 git id 입력
- since에 해당 첫 시작 날짜 입력
git log --pretty="> [%h] %ad - %s"$'\n' --author=kjh0121 --since="2019-07-11" --no-merges > ../my_commit_log.md