Sub folder in Git project?

I have been using Subversion for a long time and now I have switched to Git.

Now I need to know how to get sub folders in my Git project?

  • Can I link git submodules with some kind of fallback URL? If SSH clone fails, git should be able to clone using https
  • What do these words mean in Git: Repository, fork, branch, clone, track?
  • git svn clone creates empty git repository?
  • Cloning a tree in git
  • Error running git“Cannot run program ”git": error=2
  • Git clone command stuck at "Cloning into 'repo'
  • I know sombody will make 2 projects for this but I dont need 2 projects for this. I need to clone a subfolder and not my main project.

    I use

  • GIT merge error “commit is not possible because you have unmerged files”
  • bash git pre-commit hook running MatLab function does not wait for a result
  • Cloning local Git repository containing a submodule with local branch
  • Jenkins “tag” build with git
  • How can I tell whether the current working directory is ignored by Git?
  • Git - checkout a single directory out of a repo - error: pathspec did not match any file(s) known to git
  • 4 Solutions collect form web for “Sub folder in Git project?”

    When cloning a git repository you always clone the whole repository.

    If you want subfolders in your project simply create them though. As soon as you add files inside them (git only tracks files no folders -> if a folder is empty you cannot add it to your repo), they can be committed to your repository by committing the files inside.

    Yes, you can! Github also provides SVN access for repositories. For example I want to get Android fonts here:
    Just run this command, see the pattern, replace /tree/master with /trunk:

    svn checkout
    1. create a folder
    2. “git add” this folder
    3. “git commit -m ‘message'”
    4. “git push”


    I found an answer:

    I had git 1.5.5, and it requires 1.7+; now I have 1.7 and it’s all working fine. 🙂 But thanks a lot for the answer.

    Git Baby is a git and github fan, let's start git clone.