-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
git.sh
executable file
·22 lines (19 loc) · 914 Bytes
/
git.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
##############################################################################
# Filename: .../dotfiles/git.sh #
# Purpose: File that manage git #
# Authors: Giulio Coa <[email protected]> #
# License: This file is licensed under the LGPLv3. #
# Pre-requisites: #
# * git #
##############################################################################
if ! command -v git > /dev/null 2> /dev/null; then
echo -e "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: ${bold_red:-}git isn't installed${reset:-}" > /dev/stderr
exit 1
fi
# Clean a repository
git-clean-all() {
git reset --hard
git clean --force -d
git stash clear
}