5

I have a (private) project in github where a team of developers commits changes. A client has now asked to develop some heavy customizations on their own copy of the system. A new team will be working on this project, but I don't want this team to have access to the original repository. So I created a new repository on github, and initialized it with the code from the original project.

However, I still want the 2nd project to get the updates done on the original project. How can I setup the repositories to meet this need?

Alternatively, if I am to keep a single project, is there a way to have the new team only access a specific branch on it?

periklis
  • 10,102
  • 6
  • 60
  • 68
  • They need to have access to the original repository in some way. I think what you mean is they need to have read-only access. Presumably this is a private repository, otherwise the question wouldn't make any sense. – Robin Green Apr 10 '13 at 10:15
  • yes, this is a private repo. I don't want them to have access to the original project, even read-only, as it contains other data (some additional files, branches) that are not related to the code they have access to – periklis Apr 10 '13 at 10:20

3 Answers3

5

I have followed the recommendation on this site. I'm repeating the process here for anyone interested: Let's assume that the original project is checked out in projectA and the derived project in projectB:

The first time I did:

 cd path/to/projectB
 git remote add orig_project path/to/projectA 
 git fetch orig_project
 git merge orig_project/master -X theirs
 git push

Now every time I need to synchronize changes from projectA to projectB, I do:

git fetch orig_project
git merge orig_project/master
git push

orig_project can be anything. I used -X theirs the first time, because otherwise all fetched changes conflicted

periklis
  • 10,102
  • 6
  • 60
  • 68
1

Take the other data out of the repository. Make a new repository with only the files and branches you want them to be able to see, and delete them from the old repository. Then give them read-only access to the new repository.

Community
  • 1
  • 1
Robin Green
  • 32,079
  • 16
  • 104
  • 187
0

What you are looking for is called branch (and i see that you using it).

https://help.github.com/articles/branching-out http://learn.github.com/p/branching.html

Once you have the branches you dont need a new codebase, you can use fork (Tell them to for you project) and this way they can get updates

Read mroe here: Definition of "downstream" and "upstream"

Community
  • 1
  • 1
CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • And how can I prevent the 2nd team from accessing the original codebase? I want them to have access to a single branch of the project – periklis Apr 10 '13 at 10:22