mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
git-setup argument is now optional, defaulting to the CWD
This commit is contained in:
parent
938bf5420f
commit
1b5d9890f9
|
|
@ -242,6 +242,6 @@ Remove the latest 3 commits:
|
|||
|
||||
Updates git extras. clones the repo to _/tmp/git-extras_, make installs, then cds back to the origin directory.
|
||||
|
||||
## git-setup
|
||||
## git-setup [dir]
|
||||
|
||||
Set up a git repository if one doesn't exist, add all files and make an initial commit.
|
||||
Set up a git repository if one doesn't exist, add all files and make an initial commit. _dir_ defaults to the current working directory.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
test -z "$1" && echo "path required." && exit 1
|
||||
cd "$1"
|
||||
test -d .git && exit
|
||||
git init && git add . && git commit -m 'Initial commit'
|
||||
dir=${1-.}
|
||||
cd $dir \
|
||||
&& git init \
|
||||
&& git add . \
|
||||
&& git commit -m 'Initial commit'
|
||||
|
|
|
|||
Loading…
Reference in a new issue