https://github.com/git/git
Raw File
Tip revision: c9ed27b9e8372822219780705128cf37bd25e26b authored by Junio C Hamano on 19 October 2005, 09:31:27 UTC
GIT 0.99.8f
Tip revision: c9ed27b
git-add.sh
#!/bin/sh

show_only=
verbose=
while : ; do
  case "$1" in
    -n)
	show_only=true
	verbose=true
	;;
    -v)
	verbose=true
	;;
    *)
	break
	;;
  esac
  shift
done

GIT_DIR=$(git-rev-parse --git-dir) || exit
global_exclude=
if [ -f "$GIT_DIR/info/exclude" ]; then
   global_exclude="--exclude-from=$GIT_DIR/info/exclude"
fi
for i in $(git-ls-files --others \
	$global_exclude --exclude-per-directory=.gitignore \
	"$@")
do
   [ "$verbose" ] && echo "  $i"
   [ "$show_only" ] || git-update-index --add -- "$i" || exit
done
back to top