2

We're trying to set up github version control for a Jsp-project in NetBeans 7.0.1. The problem is we don't have a clue what to do. I Have set up a public account on github and done all the steps in the install guide on github, ssh keys and everything. So if I wanted to work on my own in this project I wouldn't have a problem.

The problem is how to get my collaborator started. He has an account on github. he set it up with ssh keys and such. In the admin view on github I added him as a collaborator, but we don't know the next step.

So the question is how to connect the collaborator to the project? something like this I suppose?

git remote add origin git@github.com:username/Hello-World.git
git pull

(another question: Do I git only the source files or the whole project folder?)

Erik L
  • 126
  • 4
  • 15

2 Answers2

1

For the first access, what your collaborator should be able to do is a git clone of your repository.
That will set for him the remote address.
If he is declared as a collaborator, he then should be able to push/pull to that remote repo.

Note that your collaborator should have received a push notification access.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thanks! do we only do version control on the source folder or the whole project folder? – Erik L Sep 26 '11 at 11:18
  • @ErikL You should version everything you need to work. If the project folder is needed, then yes, you can version it. See for instance http://stackoverflow.com/questions/337304/which-eclipse-files-belong-under-version-control/337317#337317 – VonC Sep 26 '11 at 12:55
  • I think we'll skip version control this time and try that next time, it has taken too long to get this up and running. But I will try this next time I need version control. – Erik L Sep 28 '11 at 07:13
1

Regarding your second question... That's a tough one.

A few months ago I was working with a colleague on a JavaEE project and we initially decided to share the whole Eclipse project. Since I was working on Windows and he was working on Linux, we had much trouble maintaining everything. Also we had to make sure that we don't accidentally push up our .project dir, because that would overwrite the settings on the other persons machine, messing up the whole project. So we ended up removing all the project files from the repository and just keeping the source folders (src and WebContent). Both of us set up an empty project, made our settings and than imported the source code from the repository. Was some trouble setting it up until everybody had the same project settings, but afterwards it worked like a charm. For just two developers that is fine, I guess for a bigger team, there might be better solutions.

So, I guess Netbeans handles the project settings in a similar way. So in my opinion you should just share the code.

klaustopher
  • 6,702
  • 1
  • 22
  • 25
  • yeah, NetBeans didn't seem to like that we had the same project files. It only works on my computer since the project was started there. – Erik L Sep 28 '11 at 07:10