如何在GitHub存储库中创建文件夹? [英] How do I create a folder in a GitHub repository?

查看:187
本文介绍了如何在GitHub存储库中创建文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在GitHub存储库中创建一个文件夹,并希望在该文件夹中添加文件.我该如何实现?

I want to create a folder in a GitHub repository and want to add files in that folder. How do I achieve this?

推荐答案

您不能创建一个空文件夹,然后将文件添加到该文件夹​​,但必须同时创建一个文件夹至少添加一个文件.在GitHub上,您可以这样操作:

You cannot create an empty folder and then add files to that folder, but rather creation of a folder must happen together with adding of at least a single file. On GitHub you can do it this way:

  • 转到要在其中创建另一个文件夹的文件夹
  • 点击新文件
  • 在文件名的文本字段中,首先输入要创建的文件夹名称
  • 然后键入/ .这将创建一个文件夹
  • 您可以类似地添加更多文件夹
  • 最后,给新文件起一个名字(例如,.gitkeep,它通常是 用来使Git跟踪原本为空的文件夹;但这不是Git的功能)
  • 最后,单击提交新文件.
  • Go to the folder inside which you want to create another folder
  • Click on New file
  • On the text field for the file name, first write the folder name you want to create
  • Then type /. This creates a folder
  • You can add more folders similarly
  • Finally, give the new file a name (for example, .gitkeep which is conventionally used to make Git track otherwise empty folders; it is not a Git feature though)
  • Finally, click Commit new file.

这篇关于如何在GitHub存储库中创建文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆