Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename a directory/folder on GitHub website?

People also ask

Can you rename Git repo folder?

Yes, it is safe to rename the folder containing a Git repository.

Can you rename files in GitHub?

In your repository, browse to the file you want to rename. In the upper right corner of the file view, click to open the file editor. In the filename field, change the name of the file to the new filename you want. You can also update the contents of your file at the same time.


Actually, there is a way to rename a folder using web interface.

1) Type a folder name followed by slash to go down into a subfolder. 2) Type dot dot, then slash, to jump upwards one directory. 3) Use the backspace key to edit the parent directory's name.

See https://github.com/blog/1436-moving-and-renaming-files-on-github


There is no way to do this in the GitHub web application. I believe to only way to do this is in the command line using git mv <old name> <new name> or by using a Git client(like SourceTree).


You can! Just press edit as per @committedandroider's original post and then hit backspace with your cursor at the start of the filename. It will let you then edit the folder. When done hit forward slash to then edit the filename again.


I had an issue with github missing out on some case sensitive changes to folders. I needed to keep migration history so an example of how I changed "basicApp" folder in github to "basicapp"

$ git ls-files
$ git mv basicApp basicapp_temp
$ git add .
$ git commit -am "temporary change"
$ git push origin master
$ git mv basicapp_temp basicapp
$ git add .
$ git commit -am "change to desired name"
$ git push origin master

PS: git ls-files will show you how github sees your folder name