Skip to content

Instantly share code, notes, and snippets.

@sankalp-khare
Created June 3, 2015 21:14
Show Gist options
  • Save sankalp-khare/1bfdb7687c8d5aecaadd to your computer and use it in GitHub Desktop.
Save sankalp-khare/1bfdb7687c8d5aecaadd to your computer and use it in GitHub Desktop.
sets your repo's local config so that your commits show proper name and link to your github account
#!/bin/bash
# queries you for github username and name
# sets your name, and your email as:
# name : <input-name>
# email : <input-github-username>@users.noreply.github.com
echo -n "Enter the name you want in your commits: "
read name
echo -n "Enter the github ID you want referenced: "
read id
# why replace-all and not add? | http://stackoverflow.com/a/17317076/1527814
# setup name for commits
git config --local --replace-all user.name "$name"
# setup email for commits
git config --local --replace-all user.email "${id}@users.noreply.github.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment