2

Original problem:

I am interested in forking and contributing to a public repository. Problem is, I wish to only update and retrieves updates for a single subdirectory in the public repository.

First attempt:

  1. Fork the public repository
  2. Clone the newly forked repository
  3. Update .gitignore files for the unwanted folders and files
  4. Untrack and delete unwanted directories and files using git "git rm -r --cache ."

Problem: When I wish to retrieve updates from the original public repository, the folders and files I have removed from my local repository are still being tracked in the public repository and thus i have to manually weed out all the unwanted content killing my process.

I thought of doing (described here):

  1. Clone public repository
  2. Create another public repository
  3. Use git subtree split to push folder to newly created public repository

Problem: The newly created public repository is no longer a "Fork" of the original repository and lose all the benefits such as visibility from the original repository and the creation of pull requests.

Marc Pilgaard
  • 588
  • 1
  • 5
  • 20
  • 1
    If still interested, I think the following post would help you: https://stackoverflow.com/questions/24577084/forking-a-sub-directory-of-a-repository-on-github-and-making-it-part-of-my-own-r – khituras Oct 27 '17 at 09:38

1 Answers1

-1

At git level, you have to work on the whole repository, you cannot just drop everything you don't want to work on.

You just have to do your non-git-relatied work in the folder you want, then publish your modification at the repository level.

zigarn
  • 10,892
  • 2
  • 31
  • 45
  • That is unfortunate. I am going to leave this question open for a few more days. If no more suitable answer will arrive, I'll mark this as the correct answer. – Marc Pilgaard Jun 25 '17 at 16:18