Git Development Guidelines - CivicSpleen/ambry GitHub Wiki

TLDR

  1. Fork the project. When I see the fork, I'll add you to the Github team. ( Or message me with your account name )
  2. For each issue, Assign the issue to yourself, then create a branch off of develop in your own fork of the repo.
  3. Commit to your own repo. Push the branch back to your own github origin.
  4. Issue a Pull request back to CivicKnowledge:develop to submit the work.

Basic Workflow

I'd like to use the Gitflow workflow, but the earlier flow that this is based on has a better description with more examples.

I haven't reviewed them both in enough detail to determine if there are incompatibilities, but I suspect that you can use either.

Basic Process

First, visit the repository and fork it into your own repo.

Then, clone it to your workspace and setup the upstream.

$ git clone https://github.com/<username>/ambry.git
$ cd ambry
$ git remote add upstream https://github.com/CivicKnowledge/ambry.git
$ git fetch upstream 
$ git checkout -b develop origin/develop # Mult remotes, so must specify one

Now your local develop branch is connected to the origin ( your repo ) and in synced with the upstream ( The CivicKnowledge repo )

Work on a feature

To work on a feature, create a feature branch, do the work, then commit. Switch to your devlop branch and merge back in. **Be sure to put the issue number in both the branch name and commit comment. **

$ git checkout develop; git merge upstream/develop # Sync to the upstream
$ git checkout -b myfeature_#<issueno> develop
# Work, work, work
$ git commit -a -m'Finished myfeature_#<issueno> for issue #<issue_no>'
$ git push origin myfeature_#<issueno>

At this point, your Github form of ambry should have a notice that you can create a pull request from the brach you just pushed:

Important: When you issue the pull request, be sure to request the merge to the develop branch, not master.

If you want to merge the feature back onto your develop branch:

$ git checkout develop
$ git merge --no-ff myfeature
$ git branch -d myfeature # Optional; its only in your repo. 
$ git push origin develop # 'git push' probably ok. 

Now, your work is back in github, in your repository. The only thing left to do is issue a pull request. Usually, this involves:

  1. Visit your repo page for ambry ( Your fork )
  2. Switch to the develop branch
  3. Click the grey 'Pull Request' link

⚠️ **GitHub.com Fallback** ⚠️