-
Notifications
You must be signed in to change notification settings - Fork 0
Github maintenance
HansC edited this page May 21, 2025
·
3 revisions
On GitHub, you cannot directly create an empty folder from the web interface, and folders do not show up on the main page unless they contain at least one file. However, you can absolutely organize your repository by creating folders and placing files inside them.
Here’s how you can add a folder (directory) to your repository and put files in it:
- Go to your repository’s main page.
- Click the Add file button and choose Create new file.
- In the filename field, type your new folder’s name, followed by a / and then a filename (e.g.,
new-folder/README.md). - Add some content to the file, scroll down, and commit the new file.
- This will create both the folder and the file in it.
You can repeat this process to add more files to the folder.
- Clone your repository to your local machine.
- Create a new folder in your repository directory.
- Add the files you want into that folder.
- Commit and push your changes:
git add .
git commit -m "Add new folder and files"
git push- Folders will only appear on the main page if they contain at least one file.
- You cannot create an empty folder via the GitHub web interface; you must add at least one file inside it.
- Clone the repository (if you haven't already):
git clone https://github.com/your-username/your-repo.git
cd your-repo- Switch to the main branch:
git checkout main- Remove the file:
git rm path/to/your-file- Commit the change:
git commit -m "Remove unnecessary file"- Push the change to GitHub:
git push origin mainAlternatively, you can delete the file directly on GitHub by navigating to the file in the main branch, clicking the trash can (Delete) icon, and committing the change via the web interface.
Let me know if you need step-by-step guidance for your specific repository or a particular file!
Phi-Copter Wiki
This is a test