-1

I see that I can edit the file pathway while creating a file to create a new folder but I don't see how I can create a new folder without creating a new file.

This isn't answered in other questions because they don't use the web gui and don't explain that GitHub doesn't track folders.

1 Answers1

0

when naming the file, first put the name of the folder follewed by a slash:

foldername/

it will automatically convert to a folder, and present a new text box to either create another folder or the final file.

github adding a file within a folder

senorsmile
  • 740
  • 8
  • 19
  • But if I'm uploading a file then I can't name the file. – Michael Angel Mar 03 '18 at 23:47
  • 1
    This does not create an empty directory. git doesn't track directories. It tracks files and content. – PeeHaa Mar 03 '18 at 23:49
  • As PeeHaa said, empty directories won't be tracked. You'd need to first create a new file within the new directory, then you can separately upload the files directly to that directory. – senorsmile Mar 03 '18 at 23:50
  • Thank you, senorsmile and PeeHaa. It is clear to me now. My work around is to create a temporary file in order to create the directory and then upload my files to that new folder and then delete the original temporary. It seems clunky so I thought I'd ask. – Michael Angel Mar 03 '18 at 23:57
  • PeeHaa, you reported my question as the same as an unrelated question. My account is new and this triggered an automatic ban on me for posting predominately "low-quality content". I saw your downvotes too. I feel like you should treat new members better and make reports/downvotes in good faith. – Michael Angel Mar 04 '18 at 00:07
  • I think ultimately using either the desktop client or the command line is the way to go. This is probably a usability "bug" that you could suggest an improvement to GitHub. – senorsmile Mar 04 '18 at 03:32