User Tools

Site Tools


development:ohdsi_github_projects_v2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
development:ohdsi_github_projects_v2 [2016/10/19 22:13]
chrisknoll
development:ohdsi_github_projects_v2 [2017/02/02 14:41]
chrisknoll
Line 1: Line 1:
-OHDSI open-source development best practices (DRAFT) +===== Github Contributor Best Practices =====
 Contributors:​ Anthony Sena, Chris Knoll, Frank DeFalco, Peter Rijnbeek Contributors:​ Anthony Sena, Chris Knoll, Frank DeFalco, Peter Rijnbeek
  
Line 222: Line 221:
 The shared-feature-pr will contain a copy of the commits from shared-feature branch, but applied to the top of the master branch. After pushing, the branch will be available on github as a **head** of the pull request. ​ The pull request is created using the base of master and the head is set to shared-feature-pr. ​ Note: development on the feature should now continue under the shared-feature-pr branch. The old "​shared-feature"​ branch can be deleted. The shared-feature-pr will contain a copy of the commits from shared-feature branch, but applied to the top of the master branch. After pushing, the branch will be available on github as a **head** of the pull request. ​ The pull request is created using the base of master and the head is set to shared-feature-pr. ​ Note: development on the feature should now continue under the shared-feature-pr branch. The old "​shared-feature"​ branch can be deleted.
  
 +=== Syncing an upstream Fork ===
 +
 +In most cases, the repository you're contributing to is a fork of an OHDSI repository. ​ In order to get any changes from the upstream repository into your forked repository (including any PRs that you created from your own repository that were applied to the upstream'​s master), you will need to perform the following steps. ​ **Note:** this assumes that the '​upstream'​ remote was created. See Working With a Repository section for details on setting this up.  For details on the following commands, please see [[https://​help.github.com/​articles/​syncing-a-fork/​| syncying up a fork]] article from github.
 +
 +<​code>​
 +$ git fetch upstream # will fetch latest commits from the upstream repository
 +$ git checkout master
 +$ git merge upstream/​master --ff-only # merges the commits from upstream/​master into local master using fast-forward only
 +</​code>​
 +
 +We force a --ff-only because the only commits that should be applied to your forked repository'​s master branch are those commits coming in from the upstream repository. ​ This means that the only way that your commits can be seen in the master branch are if they are accepted into the upstream'​s master via a Pull Request. This is intended and by design.
 +
 +==== Conclusion =====
 +
 +In summary, the main mode of contributing to OHDSI repositories is branching from the master, and submitting Pull Requests. ​ If you do not have rights to directly push to an OHDSI repository (which is usually the case), then you must first fork the repository, submit pull requests off of branches creating from your fork.  Keeping your fork up to date involves defining an '​upstream'​ remote, and using git fetch and git merge to apply upstream commits into your fork.
 +
 +If there'​s any concerns or questions about the above procedures, please contact the developers at [[http://​forums.ohdsi.org/​c/​developers|the OHDSI developer forum]].
  
  
development/ohdsi_github_projects_v2.txt · Last modified: 2017/02/02 14:41 by chrisknoll