mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <>
Subject: Re: Default Clone Dir?
Date: Sun, 4 Aug 2019 17:20:08 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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

On 2019-08-04 at 17:13:36, wrote:
> hi,
> Is there a way to set default clone destination directory on linux?
> Currently, seems to clone to the active dir.

It sounds like you want to always clone repositories to a single
directory. git clone doesn't have a configuration setting to do that,
but you can specify the directory you want to clone. For example:

  git clone

would create a directory "git" under the current directory, but you
could also write the following:

  git clone ~/checkouts/git

to create the repository in ~/checkouts/git. You can also do this:

  git -C ~/checkouts clone

which will change to ~/checkouts and then perform the clone there. "-C"
says to change directory to the given location before running the
command; it must be specified before the "clone" command.

If you want to automate this, you can create an alias:

  git config --global alias.myclone '!f () { git -C ~/checkouts clone "$@"; };f'
  git myclone

and then your alias will always clone to that directory.
brian m. carlson: Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]

  reply	other threads:[~2019-08-04 17:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-04 17:13 Default Clone Dir? johnywhy
2019-08-04 17:20 ` brian m. carlson [this message]
2019-08-04 18:29   ` johnywhy

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:

  List information:

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

  git send-email \ \ \ \ \

* 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.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).