-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit.sh
More file actions
executable file
·26 lines (22 loc) · 818 Bytes
/
git.sh
File metadata and controls
executable file
·26 lines (22 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
# Setup Git configuration
echo
echo "Setting up Git configuration..."
git config --global core.excludesfile "~/.gitignore_global"
git config --global core.attributesfile "~/.gitattributes_global"
git config --global core.editor "hx"
git config --global core.autocrlf "input"
git config --global push.default "simple"
git config --global push.followTags "true"
git config --global init.defaultBranch "main"
git config --global credential.helper "osxkeychain"
# Prompt for user.name and user.email if not set
if [ -z "$(git config --global user.name)" ]; then
read -p "Git username: " username
git config --global user.name "$username"
fi
if [ -z "$(git config --global user.email)" ]; then
read -p "Git email: " email
git config --global user.email "$email"
fi
echo "✓ Git configured"