Open Source Platform
for interconnected virtual worlds

Working with git

From Rex community wiki

Contents

What do the different branches mean?

We adopted the development model from http://nvie.com/posts/a-successful-git-branching-model/ .

In practice we apply that approximately so: develop is a development sandbox where all kinds of things happen, but which we do keep working. New major things and breaking things are developed in branches, either in the realXtend account's repo or anyone's personal repo.

Release branch is used to make a release, branched from develop when we start to prepare for a release. After that branching, develop is free to break again. We just cherrypick bugfixes to retlease too, but (simple) fixes only.

Master is always the latest final release, and releases are tagged.

What you need?

  • Your own github account, where you have forked naali
  • git clone your-naali-repo
  • commit rights to realxtend naali repo. For getting there visit #realxtend-dev and ping antont :)

New remote

You have to do this only once per cloned repo, the remote will stay there

  1. Go to your naali working folder that you have cloned from your own repo
  2. git remote add github-rex-naali git@github.com:realXtend/naali.git

Working on new features

  1. Do work
  2. git commit -m "my stuff"
    1. if you want to make sure your code is safe from rebase errors do 'git push' to your own repo
    • Note: this will force you to do --force push to your own repo next time after rebase as you have altered the history
  3. fetch github-rex-naali
  4. rebase github-rex-naali/develop
  5. If errors occur
    1. git mergetool (should pop up winmerge or tortoise git merge tool on windows) and resolve the conflicts
    2. git rebase --continue (again to 5.1 if still errors occur)
    • NOTE: you can always go back to before rebase if erros occur and you cant fix them easily with git rebase --abort
  6. when you are done you can push to the remote replace the first develop if you are working on a different branch git push github-rex-naali develop:develop
    • NOTE: Never use --force param for this remote push, this will mess up everyone elses historys when they pull/fetch from the repo later. If push gives you problems, someone might have pushes something after you last rebased, try fetch again and see if it gets more stuff, rebase again and push again.
  7. Push same stuff to your own repo so its synched with what develop now has 'git push'
    1. If you get fast forward errors this might mean you did 2.1 step. So you will have to do git push --force if you do this be sure that your origin in git remote -v is your own github and not the rex remote you should avoid --force pushes to your own repo also to keep it workable for others