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?

  • how to detach alternates after git clone --reference?
  • Git disable pushing from local repository
  • git clone. How to clone local repo by hardlinks?
  • Mercurial clone from a branch
  • Team member cannot clone repo from BitBucket?
  • clone git repository via active FTP
  • 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 how to save a preset git log --format
  • Automate username/password entry when git pushing over http from windows machine
  • Setting up and using Meld as your git difftool and mergetool
  • Make Git consume less disk space?
  • Git exclude a commit in a branch
  • Version control system capable of handling file moves?
  • 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.