This page documents how to develop and submit a change to the OSEHRA VistA repository. See our repository page for repository URLs and mirrors.
Before you begin, perform initial setup:
Create GitHub account
Fork the OSEHRA/VistA Repository
- Visit https://github.com/OSEHRA/VistA
- Click on "Fork" button in upper-right corner
- Elect to fork to the user's account.
Clone the newly forked repository:
$ git clone https://github.com/<username>/VistA.git
Run the developer setup script to prepare your work tree and create Git command aliases used below:
$ Scripts/SetupForDevelopment.sh
Our collaboration workflow, based on topic branches, consists of three main steps:
- Local Development
- Update
- Create a Topic
- Code Review
- Share a Topic
- Revise a Topic
- Integrate Changes
- Merge a Topic (requires authorization by OSEHRA)
- Delete a Topic
Update your local master branch:
$ git checkout master $ git pull
All new work must be committed on topic branches. Name topics like you might name functions: concise but precise. A reader should have a general idea of the feature or fix to be developed given just the branch name.
To start a new topic branch:
$ git fetch origin $ git checkout -b my-topic origin/master
Edit files and create commits (repeat as needed):
$ edit file1 file2 file3 $ git add file1 file2 file3 $ git commit
When a topic is ready for review and possible inclusion, share it by pushing to your GitHub fork of OSEHRA/VistA.
Checkout the topic if it is not your current branch:
$ git checkout my-topic
Check what commits will be pushed to GitHub for review:
$ git prepush
Push commits in your topic branch for review by the community:
$ git push origin HEAD
Generate Pull Request
Visit the web page of the forked repository and click the "Pull Requests" tab
and then click on "New pull request" button.
Once the page loads, select the proper forks and branches for the pull request:
| Option | Value |
|---|---|
| base fork | OSEHRA/VistA |
| base | master |
| head fork | <username>/VistA |
| compare | my-topic |
A properly set up branch would look as follows:
Clicking on "Create pull request" will send an email to the administrators and kick off a CI build of the incoming branch.
If a topic is approved during code review, skip to the next step. Otherwise, revise the topic and push it back to code for another review.
Checkout the topic if it is not your current branch:
$ git checkout my-topic
To revise the 3rd commit back on the topic:
$ git rebase -i HEAD~3
(Substitute the correct number of commits back, as low as 1.)
Follow Git's interactive instructions. Preserve the Change-Id: line at the bottom of each commit message.
Return to the previous step to share the revised topic.
After a topic has been reviewed and approved in GitHub it may be submitted to the upstream repository.
Only developers authorized by OSEHRA may perform this step.
Use the "Merge pull request" button that appears on the change review page.
After a topic has been merged upstream, delete your local branch for the topic.
Checkout and update the master branch:
$ git checkout master $ git pull
Delete the local topic branch:
$ git branch -d my-topic
The branch -d command works only when the topic branch has been correctly
merged. Use -D instead of -d to force the deletion of an unmerged topic
branch (warning - you could lose commits).


