question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Git: Clone to an alternate directory name

See original GitHub issue

When performing a git clone I’d like the option to specify an alternate target directory, just as I can with git clone on the command line.

For example, this can be useful when cloning a template repository, making a few edits, then pushing back to a new origin.

The problem as it stands is that the location chosen within VSCode is only for the repository’s parent directory. There does not appear to be a way to specify the destination proper.

To illustrate further, VSCode appears to do the equivalent of:

$ mkdir -p /home/jdandrea/git/my-repo && cd $_
$ git clone https://url/to/repo.git
Cloning into 'repo'...
. . .

Whereas what I want to do instead is:

$ git clone https://url/to/repo.git /home/jdandrea/git/my-repo
Cloning into '/home/jdandrea/git/my-repo'...
. . .

Note the different clone target of my-repo vs repo.

I tried renaming the directory just after cloning, expecting VSCode to follow the name change, however this does not work as expected and is out-of-scope per #20071.

_Originally posted by @jdandrea in https://github.com/microsoft/vscode/issues/103987#issuecomment-674966458_

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:39
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
yzorgcommented, May 27, 2021

Why does VSCode ask for a directory then creates another directory inside of it that matches the repo name? I would to disable that behavior: use the directory I just gave you without adding another folder.

7reactions
joaomorenocommented, Sep 1, 2020

Oh you want a different folder name.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I clone a Git repository into a specific folder?
go to the directory where you want to clone the repo. (don't run git init command inside that directory) · simply run the...
Read more >
How to Change Folder Name When Cloning a GitHub Repo
The fastest way to change the folder name when cloning a GitHub repository is to simply specify the name you want at the...
Read more >
How to Change Folder Name during Git Clone of Repo - Sabe.io
By default, git clone will clone the repository into the current working directory, and use the repository's name as the folder name.
Read more >
Clone a Git repository into a specific folder - Techie Delight
This post will discuss how to clone a Git repository into a specific folder. The standard approach to clone is repository is using...
Read more >
git-clone Documentation - Git
NAME. git-clone - Clone a repository into a new directory ... Using an already existing repository as an alternate will require fewer objects...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found