Opencog-github-flow

From OpenCog
Jump to: navigation, search

That page is trying to summarize the steps involved to contribute to opencog via github.

Nil: this is probably standard github practice but reading http://scottchacon.com/2011/08/31/github-flow.html did not answer all my questions. If there is a link out there that covers everything we need then we can remove all that, but the for time being it is a good exercise for me anyway.

Here's what I'm doing so far

  1. From the github web site, fork
    https://github.com/opencog/opencog
    you obtain
    https://github.com/my_user_id/opencog
  2. From your computer, clone https://github.com/my_user_id/opencog
    git clone https://github.com/my_user_id/opencog
  3. Go to the project root
    cd opencog
  4. At that point you likely want to tell git what is the upstream of that branch
    git remote add upstream https://github.com/opencog/opencog
  5. Create a branch from your local master
    git checkout -b my_branch
  6. Hack, hack, hack, commit, etc
    git add myfile1 ...
    git commit -m "my commit message"
  7. Push on your remote fork
    • the first time you push that branch
      git push -u origin my_branch
    • not the first time
      git push
  8. Go back to github, to your account page
  9. Look for "Your recently pushed branches:", you should find a link named "my_branch", click on it
  10. Click on the button Pull Request
  11. Add a comment if you'd like
  12. Click on "Send pull request"

And that's it! Now either wait for someone to merge it or merge it yourself if you can or dare.

Eventually you'll want to delete your branch

  1. locally, move out of the branch if your in
    git checkout master
    then delete
    git branch -D my_branch
  2. and remotely
    git push origin --delete my_branch
When you have a new feature to code go to step 4, no need to refork opencog. If you want to update your master just fetch the upstream
git fetch upstream
and merge it
git merge upstream/master

Nil: I'm not a Git crack, it works for me, good, feel free to improve that page, thanks.