manage a project and a dynamic framework made from this project with a single git repository

I have an ios standalone project managed with git in a git repository.
With this code, I am creating an ios dynamic library which will have some slight modifications from the standalone code to make it work as a library.

Now I have to manage two different code bases and whenever I make a change in the standalone project, sometimes I miss the changes in the dynamic library.

  • Git Merge only single file from master into current branch
  • Rebasing everyone onto changed git history after filter-branch
  • Close cmd window after Git command in batch script
  • Check if directory is a Git root in one command
  • How can I find an unreachable commit hash in a GIT repository by keywords?
  • How to do versioning of .ipynb by removing output and converting?
  • Is it possible to manage the common code in the standalone project and dynamic library from a common repository or what is the right way to do this?

    I need to maintain standalone project separately because I cannot run and debug the framework easily as the standalone project.

  • Git - squash entire branch - one line squash command
  • Why can't Git handle large files and large repos?
  • We want to switch to GIT, but we need a workflow
  • Adding git commit message to all files (even unchanged)
  • CLI grammar checker for determining tense
  • Xcode snapshot fails when using git lfs
  • One Solution collect form web for “manage a project and a dynamic framework made from this project with a single git repository”

    If the standalone project can live in a subfolder of the dynamic library project, then you can use git submodule to reference a SHA1 of the first project into the second one.

    git submodule add git@github.com:AFNetworking/AFNetworking.git Vendor/AFNetworking
    

    Each time you modify anything in that subfolder, you can commit and push as usual, but also go back to your main project (the dynamic one), add, commit and push to record the new SHA1 of your submodule.

    The other approach would be to use a subtree (as illustrated here, see tutorial).

    git subtree add --prefix=Vendor/AFNetworking --squash git@github.com:AFNetworking/AFNetworking.git master
    

    I prefer the first approach, but you can see both used in the context of a IOS project in this article

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