Search code examples
gitgithubgit-clone

Pushing and tagging cloned repositories into my git server


One of our current applications relies on a cloned read-only library from github (let's call it XXLib). When I cut and release a build of my application, I tag it as a specific version (say, v1.1), however, given that XXLib can and will change over time, how can I tag the specific version of XXLib into my central repository so that I can always go back and re-build?

One thought I had is to create a new repository on my central git server, add a tracking branch for XXLib in my workspace that allows me to push the contents of my workspace to our central server at the time I do the build. ie. XXLib in my workspace has two remotes (origin and mygitserver) that I use to pull (origin) and push (mygitserver)

Or is this a case for submodules?

Any thoughts would be appreciated.


Solution

  • Import the remote library as a submodule. If you need to make your own changes to it, put them in your own Git repository that pulls from the GitHub repository.

    XXLib-GitHub
      |
    XXLib-Your-Fork
      |
    Your-app