diff options
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-x | git-checkout.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/git-checkout.sh b/git-checkout.sh index 737abd0c09..92ec069a3a 100755 --- a/git-checkout.sh +++ b/git-checkout.sh @@ -146,8 +146,11 @@ fi [ -z "$branch$newbranch" ] && [ "$new" != "$old" ] && - die "git checkout: to checkout the requested commit you need to specify - a name for a new branch which is created and switched to" + die "git checkout: provided reference cannot be checked out directly + + You need -b to associate a new branch with the wanted checkout. Example: + git checkout -b <new_branch_name> $arg +" if [ "X$old" = X ] then @@ -161,7 +164,7 @@ then git-read-tree --reset -u $new else git-update-index --refresh >/dev/null - merge_error=$(git-read-tree -m -u $old $new 2>&1) || ( + merge_error=$(git-read-tree -m -u --exclude-per-directory=.gitignore $old $new 2>&1) || ( case "$merge" in '') echo >&2 "$merge_error" @@ -172,7 +175,8 @@ else git diff-files --name-only | git update-index --remove --stdin && work=`git write-tree` && git read-tree --reset -u $new && - git read-tree -m -u --aggressive $old $new $work || exit + git read-tree -m -u --aggressive --exclude-per-directory=.gitignore $old $new $work || + exit if result=`git write-tree 2>/dev/null` then |