-
Notifications
You must be signed in to change notification settings - Fork 5
Git Development Guidelines
- Fork the project. When I see the fork, I'll add you to the Github team. ( Or message me with your account name )
- For each issue, Assign the issue to yourself, then create a branch off of develop in your own fork of the repo.
- Commit to your own repo. Push the branch back to your own github origin.
- Issue a Pull request back to CivicKnowledge:develop to submit the work.
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.
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 )
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:
- Visit your repo page for ambry ( Your fork )
- Switch to the develop branch
- Click the grey 'Pull Request' link