Skip to content

Instantly share code, notes, and snippets.

@p10rahulm
Last active December 8, 2023 11:22
Show Gist options
  • Save p10rahulm/375e14ded6e06505b1d18e023e7c0cae to your computer and use it in GitHub Desktop.
Save p10rahulm/375e14ded6e06505b1d18e023e7c0cae to your computer and use it in GitHub Desktop.
This gist helps in setting up an anonymous github account and repo for submission to cs conferences.

Setup Github Repo for Anonymous Contributions


1. EXPORT SOME VARIABLES FOR USE

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 yourmailid@gmail.com actually points to your email ID as you have to verify the new account.
export NAME="EXTENDED TITLE"
export KEY="keyname-for-github"

2. SETUP THE GITHUB REPO

Follow these steps to create an anonymized GitHub repository:

  1. Create a new GitHub account using $EMAIL_ID and $NAME.
  2. Create a new repository.
  3. Copy the link for the repository push. $LINK.
export LINK="git@github.com:$GITHUB_USER/REPONAME.git"

3. SETUP THE LOCAL CONFIGS

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

4. SETUP A NEW SSH KEY

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>>'

5. START THE FIRST COMMIT

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment