Skip to content
VISHAL DEEPAK edited this page May 1, 2015 · 25 revisions

We've decided to go with the forking model because it provides less opportunities to break upstream's master (the upstream is https://github.com/rails-up/expert). Also there should be more visibility with pull requests from different people's accounts.

Tutorial

Here's a good tutorial: Atlassian forking flow tutorial. You probably won't understand everything on the first try and will have to refer to it later. Sections of interest in the tutorial: "Forking workflow" and "How it works" for general understanding; "Example" for practical stuff.

NOTE: We won't use feature branches for simplicity.
NOTE2: Nothing is actually stopping you from using feature branches within your fork.

The flow in a nutshell

Upstream repo will have a master branch with a general rule that it should always be in a working state.
There will also be a development branch - it will be the only branch that gets merged into master. You will fork the upstream using github web interface. Within your fork (the origin) you will have copies of both branches and you have to stick to development branch for your work locally.
As soon as you have cool stuff to share with others, you want to merge upstream/development into your development (locally using a git console command). Then push your development to origin/development (console command again) and go to github.com to create a pull request for merging origin/development into upstream/development.

Just give me the console commands!

make a local copy of your fork
git clone [email protected]:$name/expert.git

the rest of git commands should be run after switching to the repo directory
cd expert

switch to development before coding
git checkout development

introduce to your local git "upstream" repo
git remote add upstream https://github.com/rails-up/expert.git

merge upstream/development in before publishing your stuff
git pull upstream development

push your work to origin for making a pull request
git add . && git commit -m "$message" && git push origin development

##Pull Request Create a pull request from your Github account, which the admin will look at. If everything is fine he will make a commit.

##Sync Your Github Repository merge upstream/development to reflect changes in your local Repo
git pull upstream development (Use fetch if you do not want to make commits directly)

Push change to your Github Repo-(Named origin for example)
git push origin master

FAQ

Ask questions right here if you have the permissions or in #git_question-answers. The most frequent will be published here.

Clone this wiki locally