[TIL] vscode 로 github push 해도 contribute 가 되지 않을 때

Funnystyle·2021년 4월 15일
0

멍청하다, 녹색이 왜케 안 칠해지나, 한달 동안 그렇게 달렸는데도 빈 칸이 뚫리고, contribute 엔느 repository 생성한 기록만 쓰여져 있는 것을 보고도 아무 생각없이 지나치다가, 너무 늦게 눈치챘다.

어쨌든, 지난 건 지난 거고.
결론적으로 이야기하면

$ git config --global user.email

여기 세팅이 github 의 id 와 다르게 되어 있어서였다.
최근 프리랜서로 일한 곳의 bitbucket 의 id 로 설정을 하느라 그랬던 것이다.

아놔, 지난 1년간의 모든 github commit 이 물거품이 되어버렸다. ㅠㅠ

이제라도 알았으니 이제 녹색으로 색칠을 해볼까나.

구글 검색어를 어떻게 해야 할지 몰라
vscode commit contribute now working 라고 했다.
근데 나오더라. ㄷㄷㄷ

참고:
https://www.reddit.com/r/github/comments/bttvan/noob_question_commits_via_vscode_not_showing_up/


추가 1
github 에서 이메일 등록을 하면 된다는 정보가 있다.
하지만 나는 파견직에서 받은 email 이 들어가 있었기 때문에 해당 email 로 verify 를 할 수가 없었다.

참고:
http://jmlim.github.io/git/2019/07/11/git-contribute-graph-problem/


추가 2

이미 commit 된 이메일 정보를 갱신할 수 있는 방법을 찾았다.
나의 경우는 -f 옵션을 줘야 했고, 갱신 후 push를 해야만 했다.
아래는 나의 스크립트

git filter-branch -f --env-filter '
WRONG_EMAIL="wrong@email.com"
NEW_NAME="Funnystyle"
NEW_EMAIL="bew@email.com"

if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
then
    export GIT_COMMITTER_NAME="$NEW_NAME"
    export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$WRONG_EMAIL" ]
then
    export GIT_AUTHOR_NAME="$NEW_NAME"
    export GIT_AUTHOR_EMAIL="$NEW_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags

git push --force --tags origin HEAD:main

참고:
https://stackoverflow.com/questions/750172/how-to-change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-gi
https://github.com/HomoEfficio/dev-tips/blob/master/Git-%EC%97%AC%EB%9F%AC-commit%EC%9D%98-author%EB%A5%BC-%EB%B0%94%EA%BE%B8%EB%8A%94-%EB%B0%A9%EB%B2%95.md
https://www.git-tower.com/learn/git/faq/change-author-name-email/

profile
polyglot

0개의 댓글