Reputation: 583
Is this possible to have 2 git repositories for one directory?
Currently I have Ruby on Rails application, it is stored on BitBucket. Now I want to push this application in another repository (eg GitHub / GitLab). But I want to keep this directory connected to BitBucket.
The main ideas is my company's GitLab have unlimited users to join, but BitBucket have limited users. So meanwhile my team working on my company's GitLab, I can pull the latest code from GitLab and then push the code into BitBucket.
Or, there are any solutions to make it happens?
Currently I am thinking using DropBox for the application, so my team can working in shared folder and I can keep push the code into BitBucket. But I think this solution will bring my team into big conflict.
==== EDIT ADDITIONAL QUESTIONS ====
If I use remote so there will be :
origin git://......git
myteam git://......git
So when I want to pull from myteam repository it will be git pull myteam develop
And then when I want to push into origin repository it will be git push origin develop
Is it right? If so, what about the name of the developer on my origin repository?
Upvotes: 0
Views: 80
Reputation: 1450
You could use several remotes.
Your bitbucket remote could be the origin for you. Then you could add your GitLab as a secondary remote using
git remote add gitlab git://repo.git
Where gitlab is just your remote name. You could name it as you want.
Then your team gets only the GitLab repo URL and adds GitLab as their origin. They push their changes to GitLab. You pull the changes from GitLab and push it to bitbucket.
Upvotes: 4