Skip to content

Instantly share code, notes, and snippets.

@pedro-stanaka
Last active January 2, 2016 14:19
Show Gist options
  • Save pedro-stanaka/8316176 to your computer and use it in GitHub Desktop.
Save pedro-stanaka/8316176 to your computer and use it in GitHub Desktop.
Git configuration with prompts. Shell (Bash) script for Debian/Based distros of Linux.
#!/bin/bash
command -v git >/dev/null 2>&1 || { echo >&2 "Git is not installed. Aborting."; exit 1; }
echo "\nWhat name should be used in commits globally? \n"
read full_name
git config --global user.name "$full_name"
echo "\nWhat email should be used in commits globally? \n"
read email
git config --global user.email $email
echo "\nWhat editor should be used to edit commit messages? (default: vim) \n"
read editor
if [ -z $editor -a $editor != " " ]; then
editor = "vim"
fi
git config --global core.editor $editor
git config --global color.ui true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment