This will help to keep our git config alongside our other configuration files instead of in the home directory under `~/.gitconfig`
26 lines
749 B
Bash
Executable File
26 lines
749 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Create git config file under .config if it doesn't exist
|
|
# This helps to keep all our configs in one place
|
|
if [[ ! -f "~/.config/git/config" ]]; then
|
|
mkdir -p "~/.config/git"
|
|
touch "~/.config/git/config"
|
|
fi
|
|
|
|
# Set common git aliases
|
|
git config --global alias.co checkout
|
|
git config --global alias.br branch
|
|
git config --global alias.ci commit
|
|
git config --global alias.st status
|
|
git config --global pull.rebase true
|
|
git config --global init.defaultBranch master
|
|
|
|
# Set identification from install inputs
|
|
if [[ -n "${OMARCHY_USER_NAME//[[:space:]]/}" ]]; then
|
|
git config --global user.name "$OMARCHY_USER_NAME"
|
|
fi
|
|
|
|
if [[ -n "${OMARCHY_USER_EMAIL//[[:space:]]/}" ]]; then
|
|
git config --global user.email "$OMARCHY_USER_EMAIL"
|
|
fi
|