For example, I have a RESTful service called Purchase Service. Should I name my repository
purchaserestservice
purchase-rest-service
purchase_rest_service
- or something else?
What's the convention? How about in github? Should public repos follow some standard?
The problem with camel case is that there are often different interpretations of words - for example, checkinService vs checkInService. Going along with Aaron's answer, it is difficult with auto-completion if you have many similarly named repos to have to constantly check if the person who created the repo you care about used a certain breakdown of the upper and lower cases. avoid upper case.
His point about dashes is also well-advised.
Without favouring any particular naming choice, remember that a git repo can be cloned into any root directory of your choice:
Here
repo.git
would be cloned into themyDir
directory.So even if your naming convention for a public repo ended up to be slightly incorrect, it would still be possible to fix it on the client side.
That is why, in a distributed environment where any client can do whatever he/she wants, there isn't really a naming convention for Git repo.
(except to reserve "
xxx.git
" for bare form of the repo 'xxx
')There might be naming convention for REST service (similar to "Are there any naming convention guidelines for REST APIs?"), but that is a separate issue.
lowercase-with-hyphens
is the style I most often see on GitHub.*lowercase_with_underscores
is probably the second most popular style I see.The former is my preference because it saves keystrokes.
* Anecdotal; I haven't collected any data.
I'd go for
purchase-rest-service
. Reasons:What is "pur chase rests ervice"? Long, concatenated words are hard to understand. I know, I'm German. "Donaudampfschifffahrtskapitänspatentausfüllungsassistentenausschreibungsstellenbewerbung."
"_" is harder to type than "-"
Maybe it is just my Java and C background showing, but I prefer CamelCase (CapCase) over punctuation in the name. My workgroup uses such names, probably to match the names of the app or service the repository contains.