Change Name of Folder When Cloning from Github?

When I clone something from Github, it creates a folder with the same name as the app on my computer. Is there a way to change the name?

For example, doing this clone creates a long "sign-in-with-twitter" folder:

git clone 

I know I can rename the folder after, but I'm wondering if there's a way to rename it as it comes in by adding an option at the end of the statement. For example,

git clone   as 'signin'

the problem is that I'm cloning some apps multiple times in order to tweak some of the settings to get it to work, and if there's a problem, I delete the folder. But, I'm worried that some of the gems remain installed even though I've deleted the folder.

2

5 Answers

You can do this.

git clone  signin

# or

git clone :sferik/sign-in-with-twitter.git signin

refer the manual here

8
git clone <Repo> <DestinationDirectory>

Clone the repository located at Repo into the folder called DestinationDirectory on the local machine.

In case you want to clone a specific branch only, then,

git clone -b <branch-name> <repo-url> <destination-folder-name>

for example,

git clone -b dev  signin

Here is one more answer from @Marged in comments

  1. Create a folder with the name you want
  2. Run the command below from the folder you created

    git clone <path to your online repo> .
    

Arrived here because my source repo had %20 in it which was creating local folders with %20 in them when using simplistic git clone <url>.

Easy solution:

git clone "Repo Name"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest