Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloned Gist but want to rename folder

I cloned a Gist from GitHub to my desktop by dragging the link.

However the folder name is the undescriptive long number.

How can I rename the folder and still be able to continue committing updates from that folder to that Gist on GitHub?

Is it possible at all?

like image 459
Noitidart Avatar asked Feb 15 '14 23:02

Noitidart


People also ask

Can I rename folder after git clone?

The fastest way to change the folder name when cloning a GitHub repository is to simply specify the name you want at the end of the git clone command. Here's a short video showing the entire process: When you're done downloading the repo do cd your-app-name to enter your directory with all the Create React App files.

Can you rename a gist?

Currently, there's no way rename a Github gist. There's been an open issue on this. I would suggest you add a text file to your gist. The file name should start with space ( ), a hash sign ( # ), an exclamation mark ( ! ), a dollar sign ( $ ) or an ampersand ( & ).

How do I clone a git repository to a specific folder?

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 we rename git repository?

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.


1 Answers

Simply rename the folder! git does not care about the name of the folder, it only requires that there is a .git-folder inside.1 You can even provide the name of the folder to clone into a second parameter to git clone:

git clone repository name-of-folder

Also see this shell transcript to see that git does not care about the name:

[timwolla@/tmp]git clone https://gist.github.com/9028551.git
Cloning into '9028551'...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
Checking connectivity... done
[timwolla@/tmp]mv 9028551/ example-folder/
[timwolla@/tmp]cd example-folder/
[timwolla@/tmp/example-folder master]touch otherfile
[timwolla@/tmp/example-folder master]git add otherfile
[timwolla@/tmp/example-folder master]git commit -m "Add otherfile"
[master 5f80cf2] Add otherfile
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 otherfile
[timwolla@/tmp/example-folder master]git push
Username for 'https://gist.github.com': timwolla
Password for 'https://[email protected]': 
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 289 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://gist.github.com/9028551.git
   47890af..5f80cf2  master -> master

For reference, this is the gist: https://gist.github.com/TimWolla/9028551

1Technically don't even that

like image 101
TimWolla Avatar answered Sep 20 '22 12:09

TimWolla