Is there a naming convention for git repositories?

前端 未结 6 630
無奈伤痛
無奈伤痛 2021-01-29 17:23

For example, I have a RESTful service called Purchase Service. Should I name my repository:

  1. purchaserestservice
  2. purchase-rest-service
6条回答
  •  悲哀的现实
    2021-01-29 17:55

    Without favouring any particular naming choice, remember that a git repo can be cloned into any root directory of your choice:

    git clone https://github.com/user/repo.git myDir
    

    Here repo.git would be cloned into the myDir 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.

提交回复
热议问题