1. 이메일 확인1.1 작업하는 폴더의 email 값 변경1.2 로컬 환경의 git 전체에 email 값 설정1.3 github에 설정한 이메일 변경2. 독립적인 레파지토리가 아닐 때3. main 브랜치가 아닐 때
종종 잔디가 안심어지는 경우가 있습니다. 왜 그럴까요?
- 이메일 주소가 github 계정과 연관되어야 합니다.
- commit은 Fork한 레파지토리가 아닌 독립적인 레파지토리에서 이루어져야 합니다.
- commit은 기본 브랜치(main)에서 이루어져야 합니다.
1. 이메일 확인
나의 저장소 중 어느 레파지토리에 commit 하고 push 하면 잔디가 심어져야 하는데 심어지지 않는 경우가 있습니다. 이유는 github 계정에 등록된 이메일과 commit push 를 날리는 로컬 환경의 이메일 설정이 다르기 때문입니다. 제대로 설정이 되었는지 확인해 보도록 하겠습니다.
Settings > Emails로 들어갑니다.


등록된 이메일을 확인합니다.

로컬 환경에서의 git에 등록된 이메일을 확인합니다.
git config --list
만약, 여기서 email 값이 다르다면 commit을 하더라도 잔디가 심어지지 않습니다.

1.1 작업하는 폴더의 email 값 변경
git config user.email "email address"
1.2 로컬 환경의 git 전체에 email 값 설정
git config --global user.email "email address"
1.3 github에 설정한 이메일 변경
Settings > Emails에서 이메일을 추가합니다. 단, 이 방법은 추천하지 않습니다.

2. 독립적인 레파지토리가 아닐 때
fork 해온 레파지토리는 pull request를 할 때만 github에 잔디가 심어지고 commit은 잔디가 심어지지 않는다.
이때, 기존에 fork해온 레파지토리를 지우고, 다시 레파지토리를 생성하여 fork로 가져왔었던 레파지토리를 새롭게 clone하여 commit하고 push하는 방법이 있다. 하지만 이 방법은 이미 commit한 기록들이 다 날아갑니다.
우리는 fork 없이 레파지토리를 복사해 내 github에 새로운 레파지토리로 만들어 보겠습니다. 이 방법은 이전에 commit을 했던 기록도 함께 복사되어 잔디를 심을 수 있습니다.
저작권 문제 때문에 private한 레파지토리를 public하게 레파지토리로 만드는 것은 문제가 될 수 있습니다. 이때, 기록 용도로 private하게 만들어 참고하시는 것이 좋습니다.
github에 새로운 레파지토리를 생성합니다.

터미널을 여신 후에 복사하고자 하는 레파지토리를 bare clone 합니다.

$ git clone --bare 복사하고자 하는 레포 주소
로컬에 레파지토리가 다운되어 있습니다 해당 파일로 이동합니다.

cd 복사한 레포.git
mirror-push로 새로운 레포에 push 합니다.
git push --mirror 새로 생성한 레포 주소
처음에 임시로 생성했던 로컬 레파지토리를 삭제합니다.
cd .. rm -rf 복사한 레포.git
3. main 브랜치가 아닐 때
main 브랜치가 아닌 일반 브랜치로 push를 해도 잔디에는 적용이 되지 않습니다. 일반 브랜치를 마스터 브랜치로 merge를 해주셔야 합니다.
단, Repository >Settings > Branches 에서 Default branch를 변경해주시면 해당 브랜치의 작업 내역이 잔디에 표시됩니다.


이렇게 3가지 설정을 완료하시면 이쁘게 심어진 잔디를 볼 수 있습니다.