Sha256: 34bc5224808938121a7168e983121536ab559d51b11c5f1bfbd6cdc73af98765

Contents?: true

Size: 597 Bytes

Versions: 3

Compression:

Stored size: 597 Bytes

Contents

#!/bin/bash


# From here: http://stackoverflow.com/questions/2411031/git-how-do-i-clone-into-a-non-empty-directory

REPO=${1:-git://github.com/palladius/gceproject-dns.palladius.eu.git}
DIR=${2:-/tmp/}

echo Cloning $REPO into dir: $DIR

set +x

# git clone in non-empty dir
git clone --no-checkout $REPO $DIR/.gitclone.tmp/ &&
 mv $DIR/.gitclone.tmp/.git $DIR/ &&
  rmdir $DIR/.gitclone.tmp &&
   cd $DIR/ &&
    git reset --hard HEAD && # git thinks all files are deleted, this reverses that behaviour
     echo 'Repo succesfully checked out into: '$DIR ||
      echo "Some problems here: $?"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sakuric-2.1.3 bin/git-clone-in-non-empty-dir
sakuric-2.0.3 bin/git-clone-in-non-empty-dir
sakuric-2.0.1 bin/git-clone-in-non-empty-dir