Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

GitHub CLI: Brackets Being Automatically Replaced with Dashes in Repository Name

I’m using the GitHub CLI to help me script the migration of a number of repositories from Azure DevOps to GitHib. The repository naming convention that has been used in Azure DevOps is: BusinessArea.ApplicationName.(InternalApplicationId).

e.g.
CallCentre.TeamManager.(101)
Shipping.AddressLabelPrinter.(102)
Accounts.InvoiceGenerator.(103)

However, when I make the following CLI call:
gh repo create 'company_name/Accounts.InvoiceGenerator.(103)' --private --team=MyTeam

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

What actually gets created in GitHub is a repository named:
company_name/Accounts.InvoiceGenerator.-103-

Is where a way to force GitHub to respect the brackets and not replace them? It appears to do the same square brackets and I’m imagining other special characters too!

>Solution :

I don’t believe GitHub permits brackets in repository names, if you try and create such a repository manually then GitHub pops up a tooltip showing that it will actually name the repository with the brackets replaced with - characters as in your question:

GitHub Auto-renaming images

Other answers on SO seem to suggest that the names are restricted to [A-Za-z0-9_.-]

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading