我想在GitHub存储库中创建一个文件夹,并想在该文件夹中添加文件。我该如何做到这一点?


当前回答

下面是一种在存储库中创建文件夹的简单、快速、当前可用的浏览器方法

1)单击存储库/创建新的存储库。

2)单击“创建添加文件”,然后创建一个新文件。

3)用“/”标记给你想要创建的文件夹名称,然后在其中添加一个文件

4)提交更改

按顺序点击这里查看上述步骤的可视化表示。

其他回答

点击新文件在github回购在线。 然后写文件名为myfolder/myfilename,然后给出文件内容并提交。然后文件将在该新文件夹中创建。

实际上GitHub并不创建空文件夹。

例如,在C:\Users\Username\Documents\GitHub\Repository目录下创建一个文件夹:

创建一个名为docs的文件夹 在docs下创建一个名为index.html的文件 打开桌面应用程序GitHub 它会自动同步,它会在那里。

Git不存储空文件夹。只要确保文件夹中有一个文件,比如doc/foo.txt,然后运行git add doc或git add doc/foo.txt,一旦你提交了,这个文件夹就会被添加到你的本地存储库中(一旦你推送它,它就会出现在GitHub上)。

对于使用浏览器的用户,可以执行以下操作:

Once in the master repository, click on Create new file. In the name of file box at the top, enter the name of your folder Use the / key after the name of the folder. Using this forward slash creates the folder You can see a new box appear next to the folder name wherein you can type the name of your file. In the Commit new file box at the bottom of the page, you can type the description for your file. Select the radio button Commit directly to the master branch. Click on the Commit new file button You will see the new directory will be created.

请按照以下步骤在存储库下创建Folders

1. Login into Github.
2. Select your repository.
3. Tap on "Add file" to the "Create New File" Option.
4. Enter your Folder Name(Ex: RepositoryName/FolderName) and enter "/".
5. Enter file name to commit. I have created README.md for each folder so that it will be easy for me to maintain the details of every folder.
6. Scroll down to the Commit new file section.
7. Choose an option to merge directly to the "master" branch or "Create a new branch".
8. Finally, You need to tap on "Commit new file".

现在,只要点击Commit new file,它就会创建并带您回到Repository。