-
Notifications
You must be signed in to change notification settings - Fork 5
/
cleanup.sh
executable file
·37 lines (28 loc) · 1009 Bytes
/
cleanup.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
#!/usr/bin/env bash
# Repository cleanup
branch="`git branch --show-current`"
echo "Cleaning up repository..."
# Backup config & remove git dir
echo "Backing up config & deleting git dir..."
mv .git/config config
rm -rf .git
# Setup git
echo "Setting up git repository..."
git config --global init.defaultBranch "$branch"
git init
git config --global user.name "adi1090x"
git config --global user.email "[email protected]"
sudo git config --system core.editor vim
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=25000'
git config --global push.default simple
echo "Git repository setup complete!"
# Move config to git again & push changes to repository
echo "Moving config to git dir & push changes..."
mv config .git/config
git add --all .
read -p "Enter Commit Message: " cmt
git commit -m "$cmt"
git remote add origin https://github.com/archcraft-os/archcraft-fluxbox
git push --force --set-upstream origin "$branch"
echo "Clean up completed."