Skip to content

Instantly share code, notes, and snippets.

@gouf
Created June 14, 2016 05:16
Show Gist options
  • Save gouf/fdd82fa1f74dc23924e51fdd2b035132 to your computer and use it in GitHub Desktop.
Save gouf/fdd82fa1f74dc23924e51fdd2b035132 to your computer and use it in GitHub Desktop.
Switch git author
function switch_git_config () {
name=$1
email=$2
git config --global user.name $name
git config --global user.email $email
echo "Configuration has changed:"
echo "git config user.name: $(git config user.name)"
echo "git config user.email: $(git config user.email)"
}
function example_user () {
switch_git_config "example" "[email protected]"
}
function example_user2 () {
switch_git_config "example" "[email protected]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment