From f809e8d00538b08f5f866d00f57e344b0867fb44 Mon Sep 17 00:00:00 2001 From: Jakub B Date: Tue, 23 Jul 2024 02:33:47 -0400 Subject: [PATCH] added git configurtor --- setup-scripts/user/git.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 setup-scripts/user/git.sh diff --git a/setup-scripts/user/git.sh b/setup-scripts/user/git.sh new file mode 100755 index 0000000..41f4a2b --- /dev/null +++ b/setup-scripts/user/git.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +git_config="${XDG_CONFIG_HOME:-$HOME/.config}/git/config" + +echo 'Configuring git ...' + +if [ -e "$git_config" ] || [ -e "$HOME/.gitconfig" ]; then + echo 'error: git config already exists' + exit 1 +fi + +echo 'What name will you be using for git?' +read name + +echo 'What email will you be using for git?' +read email + +echo '[credential] + helper = /usr/bin/pass-git-helper' >> "$HOME/.gitconfig" +git config --global user.email "$email" +git config --global user.name "$name" + +mv "$HOME/.gitconfig" "$git_config"