Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change name of folder when cloning from GitHub?

Tags:

git

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 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.

like image 787
Leahcim Avatar asked Dec 20 '11 04:12

Leahcim


People also ask

How do I rename a directory in git clone?

To clone git repository into a specific folder, you can use -C <path> parameter, e.g. Although it'll still create a whatever folder on top of it, so to clone the content of the repository into current directory, use the following syntax: cd /httpdocs git clone [email protected]:whatever .

Can you rename a cloned repo?

On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. Under the Repository Name heading, type the new name of your repository. Click Rename.


2 Answers

You can do this.

git clone https://github.com/sferik/sign-in-with-twitter.git signin  # or  git clone [email protected]:sferik/sign-in-with-twitter.git signin 

refer the manual here

like image 162
MLN Avatar answered Oct 01 '22 00:10

MLN


git clone <Repo> <DestinationDirectory> 

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

like image 40
Michael Leiss Avatar answered Oct 01 '22 01:10

Michael Leiss