-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.sh
executable file
·47 lines (41 loc) · 1.49 KB
/
admin.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
40
41
42
43
44
45
46
47
#!/usr/bin/bash
############################################################
# Help #
############################################################
help()
{
echo
echo "-h Call help function"
echo "-n Change user.name to «💀»"
echo "-g Clean git history"
echo
}
############################################################
############################################################
# Main program #
############################################################
############################################################
############################################################
# Process the input options. Add options as needed. #
############################################################
# Get the options
while getopts ":h|g|n" option; do
case $option in
h)
help
;;
g)
git checkout --orphan TEMP_BRANCH ; git add -A ; git commit -m "Initial commit" ; git branch -D main ; git branch -m main ; git push --set-upstream -f origin main ; cp ~/Desktop/projects/git-repo-auto-manipulation/admin.sh .
echo "## == Successfully Cleaned Git Commit History == ##"
echo
;;
n)
git config --local user.name "«💀»"
git config --local user.email "<«💀»@killer.com>"
echo
echo "## == Successfully changed the name of user.name == ##"
echo
esac
done
help
exit