Is it possible to add a file to multiple git repos at the same time?

I've been working on Android apps for a long time. One of the problems I ran into quite often is that new people cannot deal with all the dependencies of library projects. Everything went from bad to worse with my last project, and we are using 7 libraries (2 developed in-house and many open sources). We are currently using both Bitbucket and Github for our solution.

Is it possible to just merge all projects under one Git repo? So we can just clone one and start working right away while maintaining a connection to the original repo of that open source project.

For example, it uses ActionBarSherlock, FacebookSDK, SlideMenu, etc.

If not, will Maven solve this problem?

+3


source to share


2 answers


Submodules are the solution to this problem.



You must add the repositories of these libraries as submodules to your application's repository.

+1


source


Yes. Let's assume you already have your "main" project installed, as well as your local registry and EGit settings.

  • Eclipse-> rightclick in library project -> Team -> SharePrject-> git -> set Reg as the one contained in your main file. If it's a lib, then I suggest leaving the "Path inside reg" alone. -. > Finish
  • You will get a bunch of errors. This is because the physical location of the project went into the registry. Fix dependencies-> Relay Libraries (ex support-v4) -> readd library projects-> commit.


And of course, don't forget to make a backup before doing anything.

+1


source







All Articles