Just run these commands by copy/paste or saving in a script.
#!/bin/bash
# Git initialisation script
# Just because I'm a lazy guy that dont want to do it
# manually on every installs...
# Minor arguments check
if [[ $# -eq 2 ]]; then
# General settings
git config --global user.name $1
git config --global user.email $2
git config --global push.default simple
# Working with submodules
git config --global push.recurseSubmodules on-demand
# Enable credential cache for maximum lazyness
git config --global credential.helper cache
# Confirmation
echo -e "\nInit done !\n"
git config --global --list
echo -e "\nEnjoy.\n"
else
# Usage
echo -e "\nUsage: $0 \"user name\" \"email address\"\n"
fi
That's all 😁
Then set it executable as follow:
chmod -v +x git-init.sh
You can name it without the
.sh
extension, there is no issues at all under linux.The required parser is defined by the first line
!#/bin/bash
.