mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
17 lines
303 B
Bash
Executable file
17 lines
303 B
Bash
Executable file
#!/bin/sh
|
|
|
|
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 -m 'Initial commit'
|