-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-setup.sh
39 lines (34 loc) · 1.23 KB
/
git-setup.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
#
# Script Setup Git
# Copyright (C) 2022 a Himemori <himemori@mail.com>
#
msg() {
echo
echo -e "\e[1;32m$*\e[0m"
echo
}
msg "<<--- Starting Setup --->>"
##----------------------------------------------------------##
# Git Identity
git config --global core.editor "nano"
git config --global user.name "Himemori"
git config --global user.email "himemori@mail.com"
git config --global credential.helper store
##----------------------------------------------------------##
# Git Alias
git config --global alias.c "commit -s"
git config --global alias.cam "commit --am"
git config --global alias.ca "cherry-pick --abort"
git config --global alias.cr "cherry-pick --signoff"
git config --global alias.p "push -f"
git config --global alias.cc "cherry-pick --continue"
git config --global alias.cs "cherry-pick --skip"
git config --global alias.cp "cherry-pick"
##----------------------------------------------------------##
# Setup Change-id hooks
mkdir -p ~/.git-templates/hooks
git config --global init.templatedir '~/.git-templates'
wget -q https://raw.githubusercontent.com/Himemoria/Scripts/master/commit-msg -O ~/.git-templates/hooks/commit-msg
chmod 755 ~/.git-templates/hooks/commit-msg
msg "<<--- Git Setup Succesfully --->>"