This repository has been archived by the owner on Sep 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-git-v1.sh
executable file
·68 lines (47 loc) · 1.9 KB
/
setup-git-v1.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
#!/bin/bash
##################################################################################################################
#
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
#
##################################################################################################################
# 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
# installing git if not installed for specific distro's
if ! location="$(type -p "git")" || [ -z "git" ]; then
echo "#################################################"
echo "installing git for this script to work"
echo "#################################################"
sudo apt install git -y
# check if apt-git is installed
if which apt-get > /dev/null; then
sudo apt-get install -y git
fi
# check if pacman is installed
if which pacman > /dev/null; then
sudo pacman -S --noconfirm git
fi
# check if eopkg is installed
if which eopkg > /dev/null; then
sudo eopkg -y install git
fi
fi
#setting up git
#https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-config
git init
git config --global user.name "Muhammed Efe Cetin"
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=25000'
git config --global push.default simple
echo "################################################################"
echo "################### T H E E N D ######################"
echo "################################################################"