added git configurtor
This commit is contained in:
parent
b942cfe6e3
commit
f809e8d005
23
setup-scripts/user/git.sh
Executable file
23
setup-scripts/user/git.sh
Executable file
@ -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"
|
Loading…
Reference in New Issue
Block a user