New project in github

I've started a new project at GitHub for a class project I'm working on with a few people. I realized, I have no idea how to organize this. I've only ever worked on stuff that already has a good amount of work put into it. But this is from scratch.
Should I just have the master repo, and the other guys fork off that and send me pull requests? Or should we all work on this one repo, and just make branches? It seems weird, there's going be a lot of code getting submitted since it's starting at nothing.

I'm not skilled enough in VCS stuff to really know how to handle this.
closed account (3qX21hU5)
I would say have everyone (Including you) fork and submit pull requests. That way everyone can have a say in the changes before it gets merged into the master repo.

What I usually do on my solo projects for branching is the git-flow model. You have a master branch (I would say this is what you would keep up to date with everyone else's forks), development branch (Where you develop your own forked branches) and branches for features (For different features you are working on) and bug fixes (Different bug fixes you are working on).

http://nvie.com/posts/a-successful-git-branching-model/

So lets say I am working on a feature and I complete it.

1) I would then merge the feature branch into my development branch and work out anything that might come up. Chances are that nothing will but sometimes you have multiple features running at once and you might complete another one that changes something in the development branch.

2) Once all is good there I would then merge it into my master branch and make sure it works well with everyone else's code.

3) finally after that I would submit a pull request to merge it into the main repo for the other team member to discuss it.

Anyways that is just some suggestions it really comes down to whatever works best for you and your team. I would say get everyone together and come up with one that everyone likes.
Last edited on
Branch early and branch often.
But yeah I agree with Zereo. When I work I usually fork the repo and make several different branches local to my computer for different things, then merge them when I've finished features, then submit a PR.
Alright so does this sound decent:

1) I make the master repo
2) Everyone, including me, forks this repo
3) Everyone sets up a read-only remote pointing back to the master
4) Each person makes whatever changes they want to their respective forks
5) When ready, someone can submit a merge request with the master repo
6) Everyone uses the remote pointing to the master to merge that with their own forks
When collaborating, I never merge my features into my master branch. I would say that your master branch should be an exact copy of the master-master branch. I typically do this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
From github, fork a repo
$ git clone my-fork ( $ denotes command like )
$ git remote add upstream original
$ git checkout -b my-feature ( and then do work and commit )
$ git checkout master
$ git pull upstream master
$ git checkout my-feature
$ git merge master ( and fix any merge conflicts )
$ git push origin my-feature
From github send the pull request
After it is accepted, delete my-feature from github
$ git checkout master
$ git pull upstream/master
$ git branch -d my-feature ( if this doesn't work, something isn't quite right )
$ git remote prune origin ( remove the local trackings of origin/my-feature
$git push origin master ( update github to your master )


This is a pretty strict regiment, I know. The strengths are that my master is never in a non-working state, I merged the original's master into my feature so I know that there won't be any merge conflicts ( or I solve them myself ), and I know that when I delete the branch from my local machine, that everything inside it has been merged.

I was a "team lead" on a four person project, never had a problem with master
https://github.com/Lowest0ne/food_truck_review/network


closed account (49iURXSz)
That's probably a good idea; I went on a coding spree on the dice project I was working on and look where it got me...

http://www.cplusplus.com/forum/beginner/117842/

I still have a bunch of code to clean up inside; back to work!
Topic archived. No new replies allowed.