Re: Please consider adding a -f switch to git-clone (or something similar)
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Mar 7, 2015, 22:53 UTC
- Message-ID
- <20150307225314.GC742348@vauxhall.crustytoothpaste.net>
- In-Reply-To
- <87d24kzbor.fsf@igel.home>
On Sat, Mar 07, 2015 at 11:26:28PM +0100, Andreas Schwab wrote:
Show 5 quoted lines
>Diego Viola <diego.viola@gmail.com> writes: > >> I know I could git-init in a empty directory > >You can also git init a non-empty directory.
I have a script to set up a new throwaway VM with my dotfiles using git. It looks a bit like the following ($BRANCH != master):
SSH="ssh $DEST"
$SSH "cd; $GIT init"
git push --receive-pack=$GIT-receive-pack $DEST:~/.git $BRANCH
$SSH "
$GIT pull . $BRANCH
$GIT submodule update --init
"It relies on the ability to git init a non-empty directory. $BRANCH can be master if you use the new updateInstead functionality in git 2.3.0, and you can use git pull from a remote location instead of the push/pull pair if that suits you better.
-- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187