add .gitconfig

main
Artem Dolgiy 2025-01-23 10:04:09 +03:00
parent 2b1a1e91dd
commit 942144939d
1 changed files with 31 additions and 0 deletions

View File

@ -41,6 +41,37 @@ cat << EOF >> ~/.zshrc
source ~/.aliases
EOF
# Git config
if [ ! -f ~/.gitconfig ]; then
echo "Add aliases to .gitconfig"
cat << EOF >> ~/.gitconfig
[alias]
co = checkout
ci = commit
st = status
sw = switch
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
hi = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
t = cat-file -t
dump = cat-file -p
d = cat-file -p
undo = reset HEAD~1 --mixed
u = reset HEAD~1 --mixed
wipe = !git reset --hard
send = !git push origin HEAD
lo = log --all --oneline --graph
l = log --all --oneline --graph
EOF
else
echo "File \"~/.gitconfig\" exists, skip adding"
fi
# Shell to zsh
echo "Change shell for $USER"
sudo -k chsh -s "$(which zsh)" "$USER" # -k forces the password prompt