Git tips for GCI student participants

Hi pals participating in GCI with us, we are glad once again to have you with us and thank you for your good work so-far.

For this year’s GCI we decided to have a separate branch for all student contributions to openmrs-core and therefore please have a look at a brief summary on a guide for you as a student specifically on using git while relating to the above gci branch, having created a github account and forked and cloned openmrs-core, you may have to look into https://help.github.com/articles/generating-ssh-keys/.

  1. While at command-line, navigate to the root directory of your previously cloned openmrs-core, you can use the cd command.
  2. Fetch all branches from upstream with: git fetch --all command.
  3. Checkout gci-2014 previously fetched branch from upstream using: git checkout gci-2014
  4. Update to the current gci branch state if you have the gci-2014 upstream branch already using: git pull upstream gci-2014
  5. Now create and automatically checkout your own branch that you will be adding your changes into using some thing like: git checkout -b gci-45 change gci-45 to refer to the current ticket code/number that you are working on.
  6. After adding your code, run mvn clean install to ensure that everything is alright, use git add . to stage all your changes for committing them, use git commit -m “brieflyDescribeYourChangesHere” to commit your changes and then push your changes to remote branch by using something like: git push origin gci-45
  7. While at, https://github.com/openmrs/openmrs-core/tree/gci-2014 You should now be able to see something like:
  8. Now press the Compare & pull request button
  9. On the next page, there should be something that looks like:
  10. Now press the Edit button
  11. Then that should change to something that looks like:
  12. Now change base:master by clicking on it and rather choosing gci-2014
  13. Add all other details and at this point consider looking into Some Pull Requests tips for GCI students and then open up the PR.

This will let us merge your changes into our gci-2014 branch automatically.

In addition to the above, OpenMRS has a guide on using git which you can always refer to from here.

Best regards

6 Likes