Home > Software engineering >  GitHub CLI: Brackets Being Automatically Replaced with Dashes in Repository Name
GitHub CLI: Brackets Being Automatically Replaced with Dashes in Repository Name

Time:11-11

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

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!

CodePudding user response:

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_.-]

  • Related