Getting Started with Git

  1. Fork the main project https://github.com/OpenMRS-Australia/openmrs-cpm.git 

  2. Clone your project to a directory (using GitHub client or command line below)

    git clone http://github.com/yourUsername/openmrs-cpm.git

  3. Go into the newly cloned folder

    cd  openmrs-cpm

  4. Add the main project as a remote branch (convention typically calls it "upstream" as shown below)

    git remote add upstream https://github.com/OpenMRS-Australia/openmrs-cpm.git

  5. Make your changes and commit them locally

    1. To add a new file

      git add fileName

    2. To commit your changes

      git commit -m "This is a commit message. Make it descriptive" 

  6. Push your local changes to your GitHub.com account

    git push origin master 

  7. To contribute back to the main project,

    1. Retrieve latest changes from the main project

      git pull upstream master

    2. Resolve conflicts (if any)

    3. Commit changes

  8. Go to your GitHub.com repot (http://github.com/yourUsername/openmrs-cpm.git) and to make a pull request

 

Useful Links

Interactive tutorial: https://try.github.io/

Cheat Sheet: https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf 

 

 

 

Â