Created
June 3, 2015 21:14
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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