github - github存储库名称中特殊字符的规则?

标签 github repository

除了-_ ,还有哪些其他特殊字符可以包含在 github 存储库名称中?
背景
我需要在 github url 上做一些正则表达式,并且需要知道存储库根 url 的规则,其形式为

https://github.com/username/repo
在哪里
  • username是存储库所有者的用户名,
  • repo是存储库名称

  • 到目前为止,我的正则表达式运行良好,但不适合具有特殊字符的存储库,因此我必须包含它们。用 R 编写,正则表达式是 github.com/*/[[:alpha:]] .
    注意:这里列出了rules for github usernames - 我追求同样的事情,但对于存储库名称

    最佳答案

    moby/moby issue 679 中所述:

    it looks like github allows [A-Za-z0-9_.-], and transforms all other characters to "-".



    所以:除了字母,数字,-_唯一允许的其他字符是 ' . '

    这在 GitHub 桌面应用程序中进行了说明,desktop/desktop issue 3090 :“阻止表情符号作为 repo 名称输入”(!)

    关于github - github存储库名称中特殊字符的规则?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59081778/

    相关文章:

    c++ - 我应该将项目的哪些文件放入 repo

    c++ - 如何确定哪些文件已从 rcs 中更改

    macos - 无法将分支推送到 github "Use git@github.com:Paratron/spacebattles.git"

    git - 在没有 SSH 访问的情况下在防火墙后使用 GitHub

    python - 我应该在哪里以及如何在 GitHub 上存储带有 key 和 token 的文件?

    html - 如何在另一个 HTML 文档中使用来自 Polymer Project Designer 的代码

    entity-framework - 关于使用 MVC3 和 EF 的存储库模式的建议

    git - 如何转到git中的特定提交

    java - @Autowired 不注入(inject) Spring Data JPA 存储库 - NullPointerException

    c# - Entity Framework 在 View 上抛出函数错误