Git – Change name of folder when cloning from GitHub

gitgithub

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 https://github.com/sferik/sign-in-with-twitter.git

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 https://github.com/sferik/sign-in-with-twitter.git  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.

Best Answer

You can do this.

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

# or

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

refer the manual here