开发者

How should I structure the files/directories in my Git repository?

I've just started using GitHub. I've set up my public key and and have git installed on OSX. I know the commands etc. from when I studied it at university.

What I want to know: Is there any "conventional" file structure that most GitHub members use? I notice a lot of people use 'src', 'test', etc. Does anyone have more information on the recommended file structure?

At 开发者_开发百科a guess I am thinking most developers use the same file structures for all their projects hence why they look similar. If that's the case what's the best file structure to use for my projects?

I don't want users to get confused by me using unconventional file structures.


Follow the conventions followed by the community of the particular programming language.

In Perl, we generally follow a structure like:

eg/       # example scripts
lib/      # for modules
scripts/  # scripts to use the modules
t/        # tests
CHANGES
LICENSE
README


There are recommended directory structures for certain project types that you'll find alot on github, e.g. Rails, gems, etc, but not for Git per se.

Rails - http://guides.rubyonrails.org/command_line.html#rails-generate

Ruby gems - http://seattlerb.rubyforge.org/hoe/

Java - http://java.sun.com/blueprints/code/projectconventions.html

C - Folder structure for a C project


From my perspective each GitHub project (based on your question you have a repo there) should have:

  1. Integration with CI servers (Travis CI, Circle CI, etc)
  2. .github folder with issue/pull requests templates (example https://github.com/zold-io/zold/tree/master/.github)
  3. .gitingore to avoid accidentally committed temporal/local files
  4. .gitattributes for custom Git repo configuration (more https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes and https://git-scm.com/docs/gitattributes)
  5. .rubycop.yml (if it's a ruby project)
  6. Add the following badges to your readme.md
  • How should I structure the files/directories in my Git repository?

    version of your ruby gem
  • How should I structure the files/directories in my Git repository?

    license details
  • How should I structure the files/directories in my Git repository?

    commit activity per year to hightlight the status of the project
  • Hits-of-Code More about HoC here https://www.yegor256.com/2014/11/14/hits-of-code.html
  • Build Status

    How should I structure the files/directories in my Git repository?

    the status of the latest builds
  • How should I structure the files/directories in my Git repository?

    the status of dependencies (obsolte or not)
  • How should I structure the files/directories in my Git repository?

    show the vulnurabilities count(if any) for the dependencies
  • Maintainability Rating Codebeat Codacy Badge SQ coverage Codecov

    How should I structure the files/directories in my Git repository?

    as code quality badges

Projects from the examples above:

  • https://github.com/dgroup/docker-unittests (java)
  • https://github.com/mattbrictson/gem (ruby)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜