All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Kasprzak <mike@sykhronics.com>
To: git@vger.kernel.org
Subject: Can we get a git clone flag to override the "required empty directory" behaviour?
Date: Fri, 24 Jul 2015 14:04:27 -0400	[thread overview]
Message-ID: <CACjsLYAPqCujmR0wQM-CD=qrPJz1zrC11Pe=C07DUBdEsG2r7A@mail.gmail.com> (raw)

Hi,

I run a project with 2 repositories. One is a vagrant based toolchain
(a VM that runs a LAMP server), and the other is the source code.
Because I want my users to keep and make their changes to a clone of
the source repository, we can't use submodules. They make their
changes, test locally, and push them at me when they're done.

The source code goes in a 'www' subdirectory, but for an improved user
experience, I include a pre-configured version of the config file in
that 'www' directory. That way, after they check out the code and
start their local server, it just works. Easy.

What I would like to do is git clone inside that directory. Alas, git
will not let you clone in any directory containing a file.

Today we use `the workaround`, which involves doing a git init, adding
a remote origin, fetching, and finally checking it out.

http://stackoverflow.com/a/18999726

This is `fine`, but it's not a good user experience. All we really
want is a clone, and there just happens to be a configuration file
pre-installed in the same directory.

Can we please get a flag (say -f or --force) for git clone that
overrides the default behavior of not allowing you to clone in to a
non-empty directory. If there already was a .git directory in that
directory, sure that's a no-go scenario. An with a name like --force,
it should be aggressive, overwriting anything it sees. Again, git can
already do this, it's just a lot more long winded that it should be.

Thanks,

Mike Kasprzak

             reply	other threads:[~2015-07-24 18:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 18:04 Mike Kasprzak [this message]
2015-07-24 21:41 ` Can we get a git clone flag to override the "required empty directory" behaviour? Junio C Hamano

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='CACjsLYAPqCujmR0wQM-CD=qrPJz1zrC11Pe=C07DUBdEsG2r7A@mail.gmail.com' \
    --to=mike@sykhronics.com \
    --cc=git@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.