
| Current Path : /bin/X11/X11/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //bin/X11/X11/git-setup |
#!/usr/bin/env bash
# reset environment variables that could interfere with normal usage
unset GREP_OPTIONS
# put all utility functions here
# make a temporary file
git_extra_mktemp() {
mktemp -t "$(basename "$0")".XXXXXXX
}
COMMIT_MESSAGE='Initial commit'
if [ "$1" == "-m" ]; then
COMMIT_MESSAGE=$2
shift; shift
fi
gitdirexists(){
if [ -d ".git" ]; then
echo ".git directory already exists, aborting"
exit 1
fi
}
dir=$(test -z "$*" && echo "." || echo "$*")
mkdir -p "$dir" \
&& cd "$dir" \
&& gitdirexists \
&& git init \
&& git add . \
&& git commit --allow-empty -m "$COMMIT_MESSAGE"