Renaming a folder on the GitHub website

I ran into an issue recently where I had started a git repository while working on my Mac, and made a folder with a question mark (?) in it.

That is a valid folder name on Mac, but not on Windows, so when I tried to clone the repository onto my WIndow…


This content originally appeared on DEV Community and was authored by Cassidy Williams

I ran into an issue recently where I had started a git repository while working on my Mac, and made a folder with a question mark (?) in it.

That is a valid folder name on Mac, but not on Windows, so when I tried to clone the repository onto my WIndows PC later, the clone kept failing because of the folder name!

error: invalid path '<funky file name here>'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

So, I had to figure out a solution to rename my folder from the GitHub website, from my PC. It's not as intuitive as renaming a file, but I found a couple very easy options!

Edit it from the filename editor

Did you know you can add and delete folders from the filename editor itself on GitHub? I didn't, but there's a nice blog post on the subject from 2013 here.

Editing a file name and folder

So, in my case, I could go into a file inside the folder in question, hit the button to edit the file, and then update the folder name using this method.

Change the name using the GitHub web-based editor

When you're in any GitHub repository, you can hit the period (.) key and it will open the GitHub web editor! You can also do this by changing github.com to github.dev in the URL.

When you do that, a VSCode-like editor will open, allowing you to edit folders and files to your heart's content! In my particular case, I was able to edit my folder in the web editor, then use the git extension in the editor to commit the change with one click.

It's done!

Now I can clone my no-longer-weirdly-named folder onto my Windows PC with no issues! Yee haw!


This content originally appeared on DEV Community and was authored by Cassidy Williams


Print Share Comment Cite Upload Translate Updates
APA

Cassidy Williams | Sciencx (2022-04-28T20:48:10+00:00) Renaming a folder on the GitHub website. Retrieved from https://www.scien.cx/2022/04/28/renaming-a-folder-on-the-github-website/

MLA
" » Renaming a folder on the GitHub website." Cassidy Williams | Sciencx - Thursday April 28, 2022, https://www.scien.cx/2022/04/28/renaming-a-folder-on-the-github-website/
HARVARD
Cassidy Williams | Sciencx Thursday April 28, 2022 » Renaming a folder on the GitHub website., viewed ,<https://www.scien.cx/2022/04/28/renaming-a-folder-on-the-github-website/>
VANCOUVER
Cassidy Williams | Sciencx - » Renaming a folder on the GitHub website. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/04/28/renaming-a-folder-on-the-github-website/
CHICAGO
" » Renaming a folder on the GitHub website." Cassidy Williams | Sciencx - Accessed . https://www.scien.cx/2022/04/28/renaming-a-folder-on-the-github-website/
IEEE
" » Renaming a folder on the GitHub website." Cassidy Williams | Sciencx [Online]. Available: https://www.scien.cx/2022/04/28/renaming-a-folder-on-the-github-website/. [Accessed: ]
rf:citation
» Renaming a folder on the GitHub website | Cassidy Williams | Sciencx | https://www.scien.cx/2022/04/28/renaming-a-folder-on-the-github-website/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.