# Create a new profile in ~/.config/Git read -p "Enter git username: " NAME read -p "Enter Email: " EMAIL mkdir -p ~/.config/Git PROFILE_PATH=~/.config/Git/git-profile-${NAME}.conf cat <> $PROFILE_PATH [user] email = $EMAIL name = $NAME [core] editor = nvim EOT # Include the profile in gitconfig touch ~/.gitconfig read -p "Default profile? (y/n) " DEFAULT if [ "$DEFAULT" != "y" ]; then read -p "Enter profile directory (for example '~/Work'): " DIR cat <> ~/.gitconfig [includeIf "gitdir:${DIR}/**"] path = $PROFILE_PATH EOT else cat <> ~/.gitconfig [include] path = $PROFILE_PATH EOT fi