diff --git a/Makefile b/Makefile index 1012686..649188f 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,19 @@ PREFIX = /usr/local -BINS = \ - git-count \ - git-ignore \ - git-changelog \ - git-delete-branch \ - git-delete-tag \ - git-fresh-branch \ - git-graft \ - git-repl \ - git-commits-since \ - git-summary \ - git-contrib \ - git-update-extras \ - git-extras-version \ - git-release \ - git-undo +BINS = $(wildcard bin/git-*) install: @echo "... installing to $(PREFIX)/bin" @$(foreach BIN, $(BINS), \ - echo "... installing $(BIN)"; \ - cp -f bin/$(BIN) $(PREFIX)/bin/$(BIN); \ + echo "... installing `basename $(BIN)`"; \ + cp -f $(BIN) $(PREFIX)/$(BIN); \ ) uninstall: @$(foreach BIN, $(BINS), \ - echo "... uninstalling $(PREFIX)/bin/$(BIN)"; \ - rm -f $(PREFIX)/bin/$(BIN); \ + echo "... uninstalling $(PREFIX)/$(BIN)"; \ + rm -f $(PREFIX)/$(BIN); \ ) -.PHONY: install uninstall \ No newline at end of file +.PHONY: install uninstall diff --git a/Readme.md b/Readme.md index 05a2a3a..8371924 100644 --- a/Readme.md +++ b/Readme.md @@ -23,6 +23,7 @@ - git repl - git undo - git update-extras + - git setup ## git-contrib @@ -228,4 +229,8 @@ Remove the latest 3 commits: ## git-update-extras - Updates git extras. clones the repo to _/tmp/git-extras_, make installs, then cds back to the origin directory. \ No newline at end of file + Updates git extras. clones the repo to _/tmp/git-extras_, make installs, then cds back to the origin directory. + +## git-setup + +Set up a git repository if one doesn't exist, add all files and make an initial commit. diff --git a/bin/git-setup b/bin/git-setup new file mode 100755 index 0000000..0320523 --- /dev/null +++ b/bin/git-setup @@ -0,0 +1,6 @@ +#!/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'