Programing

Git이 내 이메일 주소를 공개적으로 노출합니까?

lottogame 2020. 10. 6. 07:41
반응형

Git이 내 이메일 주소를 공개적으로 노출합니까?


지금까지 Git에서 읽은 가이드에서는 구성으로 이동하여 내 이름과 이메일 주소를 지정해야한다고 말합니다. 그들은 정교하지 않습니다. 그들은 단지 그것을하라고 말합니다.

Git에 내 전자 메일 주소가 필요한 이유는 무엇입니까? 그리고 더 중요한 것은 예를 들어 GitHub를 통해 내 리포지토리를 공개적으로 사용할 수 있도록하면 내 이메일 주소가 모든 사람 (스팸봇 포함)에게 표시 되나요?


Git은 이메일 주소를 사용하여 사용자를 식별하고 다른 작업 (예 : GPG 키로 태그에 서명)을 수행합니다. 이메일 주소는 사용자가 지정한 이름과 함께 커밋 로그 등에 ID의 일부로 포함됩니다. 예를 들어 커밋 로그의 "author"필드는 다음과 같이 표시됩니다.

Author: Joe White <joewhite@mysite.com>

따라서 정보는 식별자 역할을하므로 저장소 사본이있는 모든 사람이 사용할 수 있습니다.

웹 인터페이스를 통해 저장소를 사용할 수 있도록하기 위해 Gitweb 또는 GitHub와 같은 서비스를 사용하지 않는 한 (단순히 인터넷에 올리는 것은이 작업을 수행하지 않음) 이메일이 스팸봇에 표시되지 않을 수 있습니다 .

가짜 이메일 주소를 입력하거나 빈 문자열이나 공백 또는 무언가를 사용할 수 있다고 가정합니다 (Git가 이메일의 형식이나 유효성을 확인하지 않는다고 생각합니다).하지만 저장소를 복제하는 사람이 보내야하는 경우 이메일이 유용합니다. 패치를 받거나 어떤 식 으로든 연락 할 수 있습니다.


2017 년 4 월 업데이트

" 비공개 이메일, 이제 더 비공개 "참조

GitHub는 한동안 웹 기반 커밋을 작성하기 위해 대체 "noreply"이메일 주소 사용을 지원했습니다. 오늘부터 명령 줄을 통해 GitHub에 커밋을 푸시 할 때 실수로 이메일 주소를 게시하지 않도록하는 또 다른 방법이 있습니다.

Git은 이메일 주소를 사용하여 작성한 커밋에 이름을 연결합니다. 커밋을 GitHub의 퍼블릭 리포지토리에 푸시하면 저작 메타 데이터도 게시됩니다.

실수로 이메일 주소를 게시하지 않으려면 이메일 설정에서 '내 이메일 주소를 비공개로 유지'및 '내 이메일을 노출하는 명령 줄 푸시 차단'옵션을 선택 하면 됩니다.

https://cloud.githubusercontent.com/assets/33750/24673856/a995cb74-1947-11e7-8653-65bc604a4101.png

참고 : orev의해 아래설명대로 Git 은 아무것도 노출하지 않습니다. Git 리포지토리 호스팅 서비스 인 GitHub 가 있습니다. 로컬 Git 저장소를 푸시하는 위치는 메타 데이터를 노출 할 수 있습니다.


참고 : 2013 년 8 월 9 일 부터 이제 이메일 주소를 비공개로 유지할 수 있습니다 !

이는 웹 기반 GitHub 작업을위한 것입니다. 커밋에는 여전히 GitHub 계정에 사용 된 주소와 같거나 같지 않을 수있는 이메일 주소가 포함되어 있습니다.
(git commit) 이메일도 "마스킹"하려면 아래를 참조하십시오.

오늘까지 모든 웹 기반 GitHub Flow는 기본 이메일 주소를 사용했습니다. 여기에는 파일 생성, 편집 및 삭제와 풀 요청 병합이 포함됩니다.

하지만 이제 이메일 주소를 비공개로 유지할 수 있습니다. 이렇게하려면 이메일 설정 페이지를 방문하세요.

이메일 설정

이 기능을 켜면 웹 기반 작업에서 username@users.noreply.github.com 이메일 주소를 사용합니다.


컴퓨터에서 만든 이메일을 숨기려면 이제 GitHub에서 다른 이메일 주소등록 할 수 있습니다 . 이 가이드를 참조 하세요 .

커밋이 반영되도록하려면 GitHub로 푸시하기 전에 로컬 저장소에서 (가짜) 이메일을 구성해야합니다.

git config --global user.email "user@server.fake" # Set email to slightly changed value
git config --global user.email # Verify the setting
# user@server.fake

그때:

  • 이메일 설정 메뉴로 이동
  • "다른 이메일 주소 추가"를 클릭하십시오.
  • 가짜 이메일 (예 : " user@server.fake")을 입력하고 "추가"를 클릭합니다.

새 이메일 주소 추가

참고 :

This setting only affects future commits.
If you want to erase your real email address from your repository's commit history, you will have to rewrite your old commits. The easiest way to do this is to:

Use git filter-branch to rewrite the repository history and Force-push the new history up.


GitHub has a help article called Keeping your email address private, which begins:

Git requires you to identify yourself in order to make commits, but you can hide your contact information by using a fake address. Git itself doesn't care if the email is valid.

Good to know: Although Git does not care, some projects might not accept contributions from you if your commits do not have a valid email address, so you will want to research your project's contribution policies before following these instructions.

GitHub does not get many reports of spam being sent to Git commit email addresses, but if you are worried about it, this guide should help you address those concerns.

The guide contains steps how to configure both Git and GitHub to use a fake address.


Yes, the above answers are correct ... except you want to typically have the same email address for all your projects then you would use the command:

git config --global user.email "me@email.com"

You can also edit the .gitconfig file in your home directory, in the user section.

You can specify a different email for a particular project by doing the same command without the global option.

Also, I suggest that you can obfuscate your email if the submits are going to a public area:

briancolfer(at)comcast.net

As an example.


Yes, your email address (as specified in git config user.email) will be visible in web interfaces like GitWeb. Also everybody can learn your email address by cloning your repository though this is probably still far beyond spambots. Nobody forces you to use a real email address, though. Git will automatically set a constructed email address if none is given. On my machine without user.email it shows commits by “Foo <foo@daughter.(none)>”.


You can retroactively change the author name, email etc. BEWARE that doing the following can corrupt your history.

#!/bin/sh

git filter-branch --env-filter '

an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"

if [ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ]
then
    cn="Your New Committer Name"
    cm="Your New Committer Email"
fi
if [ "$GIT_AUTHOR_EMAIL" = "your@email.to.match" ]
then
    an="Your New Author Name"
    am="Your New Author Email"
fi

export GIT_AUTHOR_NAME="$an"
export GIT_AUTHOR_EMAIL="$am"
export GIT_COMMITTER_NAME="$cn"
export GIT_COMMITTER_EMAIL="$cm"
'

Taken from here


GitHub has a help section about setting your email address.

Specifically it says:

Good to know: You don't have to give a valid email. If you're concerned about spam, use a fake email instead. user@example.com is a common practice.


Millions of GitHub commit emails: https://github.com/cirosantilli/all-github-commit-emails extracted from GitHub Archives https://www.githubarchive.org exports commit.

GitHub Archive gets data from GitHub's events API: https://developer.github.com/v3/activity/events/types/#pushevent and exports it to Google BigQuery hourly which makes it easier to query.

Emails are shown on events of type PushEvent.

커밋 이메일이 GitHub의 웹 인터페이스 어디에도 표시되지 않는다고 생각하므로 모든 컬렉션은 API 속도 제한에 의해 제한됩니다. TODO : API를 통해 처음부터 100 만 개의 이메일을 수집하는 데 걸리는 시간입니다.

API로 누군가의 커밋 이메일을받는 실용적인 방법

ghmail() { curl "https://api.github.com/users/$1/events/public" | grep email; }
ghmail cirosantilli

또는 방문 : https://api.github.com/users/cirosantilli/events/public

또한 다음이 있습니다.

참고 URL : https://stackoverflow.com/questions/897586/does-git-publicly-expose-my-e-mail-address

반응형