add .gitconfig
parent
2b1a1e91dd
commit
942144939d
|
@ -41,6 +41,37 @@ cat << EOF >> ~/.zshrc
|
||||||
source ~/.aliases
|
source ~/.aliases
|
||||||
EOF
|
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
|
# Shell to zsh
|
||||||
echo "Change shell for $USER"
|
echo "Change shell for $USER"
|
||||||
sudo -k chsh -s "$(which zsh)" "$USER" # -k forces the password prompt
|
sudo -k chsh -s "$(which zsh)" "$USER" # -k forces the password prompt
|
||||||
|
|
Loading…
Reference in New Issue