export TITLE="SOME TITLE"
export GITHUB_USER="github-user"
export EMAIL_ID="yourmailid+$GITHUB_USER@gmail.com"
# Note: Gmail ignores all characters beyond the '+' symbol
# Ensure [email protected] actually points to your email ID as you have to verify the new account.
export NAME="EXTENDED TITLE"
export KEY="keyname-for-github"
Follow these steps to create an anonymized GitHub repository:
- Create a new GitHub account using
$EMAIL_ID
and$NAME
. - Create a new repository.
- Copy the link for the repository push.
$LINK
.
export LINK="[email protected]:$GITHUB_USER/REPONAME.git"
Ensure that the default name for a branch is main
.
git init
git config --local user.name "$NAME"
git config --local user.email $EMAIL_ID
Set up a new SSH key (save it in ~/.ssh/$KEY
):
ssh-keygen -t ed25519 -C "$EMAIL_ID"
# Paste the key generated in GitHub > Settings > SSH and GPG Keys > SSH Keys
cat ~/.ssh/$KEY.pub
Add the key to the account:
git config --add core.sshCommand "ssh -i ~/.ssh/$KEY"
# If the key changes, unset the local git key using
# git config --unset --local core.sshCommand '<<ssh_token_path>>'
Run the following commands to set up git:
git add -A
git commit -m "initialize repo"
git remote add origin $LINK
git push --set-upstream origin main
Add a license file to your remote GitHub repository and pull it into the local repository:
git pull
Now the setup is complete, and you can start using the repository.