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

Next revision
Previous revision
Next revision Both sides next revision
development:ohdsi_github_projects_v2 [2016/10/18 18:53]
chrisknoll created
development:ohdsi_github_projects_v2 [2016/10/19 16:26]
chrisknoll
Line 1: Line 1:
 OHDSI open-source development best practices (DRAFT) OHDSI open-source development best practices (DRAFT)
 +
 Contributors:​ Anthony Sena, Chris Knoll, Frank DeFalco, Peter Rijnbeek Contributors:​ Anthony Sena, Chris Knoll, Frank DeFalco, Peter Rijnbeek
  
Line 13: Line 14:
  
 http://​forums.ohdsi.org/​c/​developers http://​forums.ohdsi.org/​c/​developers
 +
 +==== Code Management ====
 +
 +The following section is described how to work with source code in a Git repository. It provides a general overview of using Git and explains how to provide code contributions. Subsequently,​ the Release Management section will focus on best practices and conventions for controlling versions and releases of the source code in a repository. ​
 +
 +=== Forking and Cloning ===
 +
 +In order to begin working on OHDSI code, you will either need to clone a repository (repo) either directly from the OHDSI or from a fork that you create. ​ If you do not have permissions to push changes into a repo (which is usually the case when you are an external collaborator),​ then you can go to the main OHDSI repository site (example: https://​github.com/​ohdsi/​atlas) and click the Fork button in the top right area of the screen. ​ This will create a copy of the repository under your own user repository in GitHub. For example, if you were to fork https://​github.com/​ohdsi/​atlas,​ it would create the new repository under https://​github.com/​{your github user}/​atlas. ​ You have full permissions to commit changes to the personal repo you forked, and can submit ehancements to the OHDSI repo via pull requests (discussed later).
 +
 +=== Working with a repository ===
 +
 +Once you know the repository you want to work on (either a fork or directly in the OHDSI repo), you will then need to clone it locally. Create a directory that you'd like to use to store your Git code (i.e. C:\Git). Then using the Git command line, navigate to the directory you created and clone a repository using the following command:
 +
 +<​code>​
 +cd C:\git
 +git clone "​https://​github.com/​{owner}/​{RepoName}.git"​
 +</​code>​
 +
 +This will create a directory {RepoName} under the directory you executed the git command (in this example, C:​\Git). ​ This will also copy down the repo contents, and set your active branch to '​master'​. ​ We will talk about branching in a later section.
 +
 +To see the history in the repo, you can use any of the following commands:
 +
 +<​code>​
 +$ git log
 +$ git log --graph
 +$ gitk
 +</​code>​
 +
 +gitk will launch a UI that let's you see the commits in a visual graph and is the recommended commit history viewer.
 +
 +If everything looks good, then congratulations! ​ You have cloned your repository and are ready to contribute!
 +
 +
 +
 +
 +
  
development/ohdsi_github_projects_v2.txt ยท Last modified: 2017/02/02 14:41 by chrisknoll