Git development
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Diego Viola <diego.viola@gmail.com>, git@vger.kernel.org
Subject: Re: Please consider adding a -f switch to git-clone (or something similar)
Date: Sat, 7 Mar 2015 22:53:14 +0000	[thread overview]
Message-ID: <20150307225314.GC742348@vauxhall.crustytoothpaste.net> (raw)
In-Reply-To: <87d24kzbor.fsf@igel.home>

[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]

On Sat, Mar 07, 2015 at 11:26:28PM +0100, Andreas Schwab wrote:
>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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-03-07 22:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-07 21:54 Please consider adding a -f switch to git-clone (or something similar) Diego Viola
2015-03-07 22:26 ` Andreas Schwab
2015-03-07 22:53   ` brian m. carlson [this message]
2015-03-08  0:02   ` Diego Viola
2015-03-08  1:53     ` Diego Viola
2015-03-08  2:32       ` Kyle J. McKay
2015-03-08 18:27         ` Diego Viola

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150307225314.GC742348@vauxhall.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=diego.viola@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox