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

How should I structure a local Git repository (folder names, content , I'll use python as my example, since your edit history in How should I structure a local Git repository (folder names, content, etc.)? for any project is including a README file and a LICENSE file in the root of the project's directory layout. 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?

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

Git Repository Structure, – objects/ folder. Data of your Git objects is stored in this directory. – – objects/[0-9a-f][0-9a-f] folders. A newly created object is stored in its own file. – – objects/pack folder. – – objects/info folder. – refs folder. – – refs/heads/ folder. – – refs/tags/ folder. – – refs/remotes/ folder. On an SELinux-enabled system, the default directory is /var/www/git, and repos should be in subdirectories thereof. Or, you can use, e.g. /srv/git and set the file context to be equivalent: semanage fcontext -a -e /var/www/git /srv/git

Explore Git's file structure, Inside this folder is a whole world of structure, called the working git tree! how your repository looks while you are using Git in case your files� I used the directory name /git on a server run by my company for work related things, and for personal use I also created a directory called /git on a private web server. Inside your /git directory you can then create bare repositories for your projects. ssh git@myserver cd /git mkdir Project7sName.git cd Project7sName.git git init --bare echo

gitrepository-layout Documentation, a <project>.git directory that is a bare repository (i.e. without its own working to the object database, not to the repository!) in your alternates file, but it will not� Yes you can simply move the files over. However you do need to tell git that the old files in the webapp folder have gone, that is, git needs to update its index of finished/committed files. So you can use git add -A . to make git notice all the changes, or use the git mv <files> to tell git to do the move itself. See the git mv man page.--update.

What's the best structure for a repository?, If your are using git you can always reshape later, don't worry about it too much. This is the directory where all your dependencies should be stored. Also� Using Git Bash, prepare to run the clone command to pull a copy of a repository (your fork) down to your device on the current directory. Authenticate by using Git Credential Manager If you installed the latest version of Git for Windows and accepted the default installation, Git Credential Manager is enabled by default.

kriasoft/Folder-Structure-Conventions: Folder / directory , Folder / directory structure options and naming conventions for software The actual source files of a software project are usually stored inside the src folder. For example, if you publish your source code in a public repository on GitHub, you� Should I add an additional git repository for the static files? Having said that, I realize that my current repository structure is inappropriate because I will be slapping myself if I have new, independent projects in the future under django as well as css and js files for other projects.

Comments
  • As you're seeing in the answers, this really isn't a git question, it's a language question - you might want to ask about the specific language of your project.
  • I use PHP. Sorry should have mentioned that. Although cannot seem to find any conventions for PHP.
  • No, PHP hasn't really got any overall guidlines for project structure either, unless you use a framework like Symfony, CakePHP, Zend etc.