Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the format for valid Git repo names?

Tags:

git

I'm a Git noob and using GitExtensions (GE) I'm constantly having problems with "{name} is not a valid remote name". One minute GE will not allow me to add the name, then if I try to re-add it without a single name/path change GE accepts it, then later I have the above error message again randomly. One minute I'll be able to commit/push to the repo with that name, the next I can't.

I've done a bit of Google-Fu and can't seem to find anything on this.

like image 932
J. Scott Elblein Avatar asked Jan 21 '14 15:01

J. Scott Elblein


People also ask

How do I name a git repository?

On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. Under the Repository Name heading, type the new name of your repository. Click Rename.

What should repository name be?

The repository name has to be unique to your account. That means that someone else can have a repository on GitHub named my-awesome-repo , and you can have one as well. You cannot however have two repos by the same name under your account. Choose a descriptive name based on your project.


1 Answers

Git repository name can be logically anything, but it's slug (how it is stored to disk and how it's cone URL can be formed) can differ from the name. However, this is totally tool specific.

I've seen some Git hosting tools that allow wide set of characters to be used as repo name but many of them are converted into dash when forming the slug. That causes the original name to have a role of "display name" in the web UI, and most of the developers won't enjoy that when working at the shell side.

In GitHub, the name may have

  • letters,
  • numbers,
  • dash (-)
  • _
  • .

In GitLab, it is similar. I've seen an error Path can contain only letters, digits, '_', '-' and '.'. Feature request to change this in GitLab

like image 199
Ville Laitila Avatar answered Sep 29 '22 16:09

Ville Laitila