github repository를 생성한 후, 매일 공부한 내용 중 일부를 커밋하고 있다.

1년 뒤 초록색으로 가득한 contribution chart를 기대하며 1일 1커밋을 실천하였으나, 

커밋을 아무리 해도 차트 셀의 색이 바뀌질 않았다.

 

github 사이트 내에서 레파지토리를 생성한다거나 커밋한 파일을 직접 삭제하면 색이 바뀌는데,

eclipse 에서 commit/push 할 경우 commit 기록엔 남게되나 차트 셀의 색이 바뀌지 않았다.

(혹시 몰라 sourcetree 도 사용해 보았지만 똑같았다)

 

위 이미지에서 Learn how we count contributions 링크를 통해 확인한 github 의 커밋(푸시)집계기준을 확인했으나 도저히 문제 파악이 되지 않았다.

 

문제는 로컬 git config 설정에 있었다.

.git/config 파일에 아래와 같이 본인이 사용중인 github 사용자 이름, email 정보를 넣어주자.

[git bash 를 사용하지 않는 경우]

[user]
name = develo-pyo
email = jungpyo9@gmail.com

[git bash 사용시]

1) repository 디렉토리로 이동

2)

>git config user.name "develo-pyo"

>git config user.email "jungpyo9@gmail.com"

혹은

>git config --global user.name "develo-pyo"

>git config --global user.email "jungpyo9@gmail.com"

※ repository 별 유저명, 메일주소 설정이 글로벌 유저명, 메일주소 설정보다 우선시 된다.

 

※ config 파일

  • /etc/gitconfig 파일: 시스템의 모든 사용자와 모든 저장소에 적용되는 설정이다. git config --system 옵션으로 이 파일을 읽고 쓸 수 있다. (git config --list 로 설정된 config 읽기 가능)
  • ~/.gitconfig 파일: 특정 사용자에게만 적용되는 설정이다. git config --global 옵션으로 이 파일을 읽고 쓸 수 있다.
  • .git/config: 이 파일은 Git 디렉토리에 있고 특정 저장소(혹은 현재 작업 중인 프로젝트)에만 적용된다. 각 설정은 역순으로 우선시 된다. 그래서 .git/config가 /etc/gitconfig보다 우선한다.

eclipse/sts git plugin 및 sourcetree 로 github 사용시 .git/config 파일만 생성되는 듯 하다.

 

 

참고 : https://alvinalexander.com/git/git-show-change-username-email-address

참고 : https://confluence.atlassian.com/bitbucket/configure-your-dvcs-username-for-commits-950301867.html

 

반응형

+ Recent posts