forked from arcolinuxiso/carli-pkgbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-our-git-credentials.sh
executable file
·120 lines (108 loc) · 4.19 KB
/
setup-our-git-credentials.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/bash
#set -e
##################################################################################################################
# Author : Erik Dubois
# Website : https://www.erikdubois.be
# Website : https://www.alci.online
# Website : https://www.arcolinux.info
# Website : https://www.arcolinux.com
# Website : https://www.arcolinuxd.com
# Website : https://www.arcolinuxb.com
# Website : https://www.arcolinuxiso.com
# Website : https://www.arcolinuxforum.com
##################################################################################################################
#
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
#
##################################################################################################################
#tput setaf 0 = black
#tput setaf 1 = red
#tput setaf 2 = green
#tput setaf 3 = yellow
#tput setaf 4 = dark blue
#tput setaf 5 = purple
#tput setaf 6 = cyan
#tput setaf 7 = gray
#tput setaf 8 = light blue
##################################################################################################################
# Problem solving commands
# Read before using it.
# https://www.atlassian.com/git/tutorials/undoing-changes/git-reset
# git reset --hard orgin/master
# ONLY if you are very sure and no coworkers are on your github.
# Command that have helped in the past
# Force git to overwrite local files on pull - no merge
# git fetch all
# git push --set-upstream origin master
# git reset --hard orgin/master
#setting up git
#https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config
#https://medium.com/clarusway/how-to-use-git-github-without-asking-for-authentication-always-passwordless-usage-of-private-git-8c32489bc2e9
#https://blog.nillsf.com/index.php/2021/05/27/github-sso-using-password-protected-ssh-keys
project=$(basename `pwd`)
githubdir="arcolinuxiso"
echo "-----------------------------------------------------------------------------"
echo "this is project https://github.com/$githubdir/$project"
echo "-----------------------------------------------------------------------------"
echo
tput setaf 1
echo "################################################################"
echo "##### Choose wisely - one time setup after clean install ####"
echo "################################################################"
tput sgr0
echo
echo "Select the correct desktop"
echo
echo "0. Do nothing"
echo "1. Erik"
echo "2. Raniel"
echo "3. Steve"
echo "Type the number..."
read CHOICE
case $CHOICE in
0 )
echo
echo "########################################"
echo "We did nothing as per your request"
echo "########################################"
echo
;;
1 )
git config --global pull.rebase false
git config --global push.default simple
git config --global user.name "arcolinuxz"
git config --global user.email "[email protected]"
sudo git config --system core.editor nano
#git config --global credential.helper cache
#git config --global credential.helper 'cache --timeout=32000'
git remote set-url origin [email protected]:$githubdir/$project
echo
echo "Everything set"
;;
2 )
git config --global pull.rebase false
git config --global push.default simple
git config --global user.name "Raniel Laguna"
git config --global user.email "[email protected]"
sudo git config --system core.editor nano
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=32000'
;;
3 )
git config --global pull.rebase false
git config --global push.default simple
git config --global user.name "Steve Younger"
git config --global user.email "[email protected]"
sudo git config --system core.editor nano
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=32000'
;;
* )
echo "#################################"
echo "Choose the correct number"
echo "#################################"
;;
esac
echo "################################################################"
echo "################### T H E E N D ######################"
echo "################################################################"