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
Next revision Both sides next revision
development:ohdsi_github_projects_v2 [2016/10/19 17:08]
chrisknoll
development:ohdsi_github_projects_v2 [2016/10/19 18:41]
chrisknoll
Line 22: Line 22:
 ==== Code Management ==== ==== 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. ​+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]] article ​will focus on best practices and conventions for controlling versions and releases of the source code in a repository. ​
  
 === Forking and Cloning === === 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).+In order to begin working on OHDSI code, you will either need to clone a repository (repo) either directly from OHDSI or from a fork of an OHDSI repo.  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 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 === === Working with a repository ===
Line 37: Line 37:
 </​code>​ </​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.+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 branches ​in a later section.
  
 An additional step for **forked repositories**: ​ In order to remain in sync with the original repository (the one that was forked from), a special remote reference will be needed in order to grab the new changes in the '​upstream'​ repository into the forked repository. ​ We will get into the details of this remote reference in the section for syncing upstream changes, but this is the command that should be executed to add the upstream reference to your forked repo (from [[https://​help.github.com/​articles/​configuring-a-remote-for-a-fork/​|Configuring a remote for a fork]] in GitHub help): An additional step for **forked repositories**: ​ In order to remain in sync with the original repository (the one that was forked from), a special remote reference will be needed in order to grab the new changes in the '​upstream'​ repository into the forked repository. ​ We will get into the details of this remote reference in the section for syncing upstream changes, but this is the command that should be executed to add the upstream reference to your forked repo (from [[https://​help.github.com/​articles/​configuring-a-remote-for-a-fork/​|Configuring a remote for a fork]] in GitHub help):
Line 79: Line 79:
 </​code>​ </​code>​
  
-The asterisk will provide you with an indicator of your current branch which in our case is "​master"​. The "​master"​ branch is, by convention, the main branch where the most stable code will live. It is no different from any other branch except that is never removed. ​+The asterisk will provide you with an indicator of your current branch which in this case is "​master"​. The "​master"​ branch is, by convention, the main branch where the most stable code will live. It is no different from any other branch except that is never removed. ​
  
 Let's start by creating a new branch for our work by issuing the command: Let's start by creating a new branch for our work by issuing the command:
Line 94: Line 94:
 </​code>​ </​code>​
  
-Git has created a new branch called "​new-feature-branch"​ and made it your current ​branch. You can verify this by running the git branch as we did above+Git has created a new branch called "​new-feature-branch"​ and made it your active ​branch. You can verify this by running the git branch as we did above
  
 <​code>​ <​code>​
Line 104: Line 104:
 </​code>​ </​code>​
    
-Now you can begin working by adding new commits to the repository. The new commits will be only visible in the '​new-feature-branch'​. ​ These commits are put into the '​master'​ branch via Pull Requests.+Now you can begin working by adding new commits to the repository. The new commits will be only visible in the '​new-feature-branch'​. ​ These commits are merged ​into the '​master'​ branch via Pull Requests.
  
 === Committing changes === === Committing changes ===
Line 114: Line 114:
 </​code>​ </​code>​
  
-This is a good option if you know all your changed files relates to a single feature or bugfix.  However, if you want to divide commits into separate logical units you can perform the following steps:+This is a good option if you know all your changed files relates to a single feature or bug-fix.  However, if you want to divide commits into separate logical units you can perform the following steps:
  
 <​code>​ <​code>​
Line 130: Line 130:
  
  
-=== Pull Requests ===+=== Pushing Changes and Pull Requests ===
  
-Once you have completed your local changes, you will want to submit them for inclusion in the main repository. ​ First, you will need to "​push"​ your changes from your local repository to your remote repository using the "git push" command:+Once you have completed your local changes, you will want to submit them for inclusion in the main repository. 
 + 
 +First, you will need to "​push"​ your changes from your local repository to your remote repository using the "git push" command:
  
 <​code>​ <​code>​
Line 140: Line 142:
 This will make your branch available on GitHub as a source for a pull request. This will make your branch available on GitHub as a source for a pull request.
  
-GitHub has an [[https://​help.github.com/​articles/​about-pull-requests/​|excellent]] article on initiating pull requests. Please refer to this article for detailed instructions. ​ The important ​items to note iswhen creating the pull request, the **base** will be set to the repository'​s branch that you wish to contribute to, and the **head** branch will the the branch that your contributions were made.  ​+GitHub has an [[https://​help.github.com/​articles/​about-pull-requests/​|excellent]] article on initiating pull requests. Please refer to this article for detailed instructions. ​ The important ​item to note iswhen creating the pull request, the **base** will be set to the repository'​s branch that you wish to contribute to, and the **head** branch will the the branch that your contributions were made.  ​
  
 If you wanted to contribute your commits from '​new-feature-branch'​ in your repository, you would navigate to your branch in GitHub, click New pull request, and then chose the target repository (OHDSI/​Atlas for example) and the branch to apply your commits to (usually '​master'​). ​ The only difference between an internal collaborator Pull Request and an External Collaborator Pull Request is that the Internal Collaborator will be making a pull request between 2 branches within the OHDSI repository, and the External Collaborator will be making a pull request between the branch in the External Collaborator'​s fork and the branch in the OHDSI repository. ​ Otherwise, it is exactly the same process. If you wanted to contribute your commits from '​new-feature-branch'​ in your repository, you would navigate to your branch in GitHub, click New pull request, and then chose the target repository (OHDSI/​Atlas for example) and the branch to apply your commits to (usually '​master'​). ​ The only difference between an internal collaborator Pull Request and an External Collaborator Pull Request is that the Internal Collaborator will be making a pull request between 2 branches within the OHDSI repository, and the External Collaborator will be making a pull request between the branch in the External Collaborator'​s fork and the branch in the OHDSI repository. ​ Otherwise, it is exactly the same process.
- 
-  
- 
- 
- 
  
  
development/ohdsi_github_projects_v2.txt · Last modified: 2017/02/02 14:41 by chrisknoll