Rules for special characters in github repository name?
Answer a question
In addition to - and _, which other special characters can be contained in a github repository name?
Background
I need to do some regex on github urls, and need to know the rules for repository root urls, which are of the form
https://github.com/username/repo
where
usernameis the username of the owner of the repository, and,repois the repository name
So far, my regex works well, but doesn't cater to repositories with special characters, so I must include them. Written in R, the regex is github.com/*/[[:alpha:]].
Note: Here are listed the rules for github usernames - I am after the same thing but for repository names
Answers
As mentioned in moby/moby issue 679:
it looks like github allows [A-Za-z0-9_.-], and transforms all other characters to "-".
So: in addition to letters, numbers, - and _ the only other allowable character is '.'
This is illustrated in GitHub Desktop application, with desktop/desktop issue 3090: "Block emoji from being entered as a repo name"(!)
更多推荐


所有评论(0)