Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 28, 2022 08:48 pm GMT

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 WIndows PC later, the clone kept failing because of the folder name!

error: invalid path '<funky file name here>'fatal: unable to checkout working treewarning: 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!


Original Link: https://dev.to/cassidoo/renaming-a-folder-on-the-github-website-5flb

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To