Hello guys I've been wondering if this could be feasible? I've been pondering over it for hours and I can't get my head wrapped around it!
Requirement:
I want to work on multiple git repositories in a project and push the code to corresponding repositories only.
Here is the overview:
I am working on multiple projects and these all projects use same custom library built by me. So, I created a git repository for the custom library and separate repositories for each project.
I created following Repositories:
lib: Custom Library
A: Project A
B: Project B
Setup for project A:
git init git remote add origin git remote add library git pull origin master git pull library master
Now after making a change in the project A code and when I try to push it by
git push origin master
then both the library code and project code are pushed to repository A.
But I want only project code should be pushed to repository A.
I have also tried doing it with branches and used following commands:
git checkout -b library git pull library library
I also tried
git pull library library:master
But getting the following error:
fatal: The remote end hung up unexpectedly