Skip to content

Instantly share code, notes, and snippets.

@gurkanakdeniz
Created July 4, 2019 17:08
Show Gist options
  • Save gurkanakdeniz/44ed715149fb23e3df303fc80682c447 to your computer and use it in GitHub Desktop.
Save gurkanakdeniz/44ed715149fb23e3df303fc80682c447 to your computer and use it in GitHub Desktop.
git configuration changer bash shell
#!/bin/sh
param=$1
config="gurkan"
name="defaultname"
mail="defaultmail"
BLUE='\033[0;34m'
ORANGE='\033[0;33m'
GREEN='\033[0;32m'
NC='\033[0m'
echo "\n${ORANGE}---- current ----${NC}"
git config --global --list
echo "${ORANGE}---- current ----${NC}\n"
if [ "$param" != "$config" ]; then
if [ "$param" != "" ]; then
config="$param"
name="$1"
mail="$2"
fi
fi
echo "${BLUE}---- new settings ----${NC}"
echo "new name : $name"
echo "new mail : $mail"
echo "${BLUE}---- new settings ----${NC}\n"
git config --global user.name "$name"
git config --global user.email "$mail"
echo "${GREEN}---- new ----${NC}"
git config --global --list
echo "${GREEN}---- new ----${NC}\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment