-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgit_setup.sh
More file actions
executable file
·51 lines (42 loc) · 1.32 KB
/
git_setup.sh
File metadata and controls
executable file
·51 lines (42 loc) · 1.32 KB
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
# Executable
echo "Type in your first and last name (no accent or special characters - e.g. 'ç'): "
read full_name
echo "GitHub: Type in your email address: "
read email_github
echo "Gitee: Type in your email address: "
read email_gitee
echo "GitLab: Type in your email address : "
read email_gitlab
git config --global user.email $email_github
git config --global user.name $full_name
ssh-keygen -t rsa -b 4096 -C $email_github -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -C $email_gitee -f ~/.ssh/gitee_id_rsa
ssh-keygen -t rsa -b 4096 -C $email_gitlab -f ~/.ssh/gitlab_id_rsa
# alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to pasteboard.'"
echo '=> Public key is'
cat ~/.ssh/id_rsa.pub
echo "Now, go to Github.com to paste the Public key"
echo " "
cat ~/.ssh/gitee_id_rsa.pub
echo "Now, go to Gitee.com to paste the Public key"
echo " "
cat ~/.ssh/gitlab_id_rsa.pub
echo "Now, go to GitLab.com to paste the Public key"
touch ~/.ssh/config
cat>~/.ssh/config<<EOF
# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitee_id_rsa
# gitlab
Host git.emnets.org
HostName git.emnets.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitlab_id_rsa
EOF