Sub in a 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 subfolders in my Git project?

I know that someone will do 2 projects for this, but for this I do not need 2 projects. I need to clone a subfolder, not my main project.

I am using github.com.

+4
source share
5 answers

I found the answer: http://blog.quilitz.de/2010/03/checkout-sub-directories-in-git-sparse-checkouts/

I had git 1.5.5 and it requires 1.7+; Now I have 1.7, and everything works fine. :) But thank you very much for the answer.

0
source

When cloning a git repository, you always clone the entire repository.

If you want the subfolders in your project to just create them. Once you add files to them (git only tracks files without folders -> if the folder is empty, you cannot add it to your repo), they can be tied to your repository, locking the files inside.

+6
source

Yes, you can! Github also provides SVN access for repositories. For example, I want to get Android fonts here:
https://github.com/android/platform_frameworks_base/tree/master/data/fonts
Just run this command, see Template, replace / tree / master with / trunk:

svn checkout https://github.com/android/platform_frameworks_base/trunk/data/fonts 
+2
source
  • create a folder
  • "git add" this folder
  • "git commit -m 'message'"
  • "git click"

DONE!

+1
source

You cannot add an empty folder. First create a file, add a folder to it, and then merge the file inside the folder. Similarly, as soon as you have a main folder, you can add files or create subfolders inside this folder.

0
source

Source: https://habr.com/ru/post/1337989/


All Articles