Unless you are a core VIVO developer, you cannot commit code directly to the VIVO repositories. Instead, you can contribute using the fork, branch, and pull model. Helpful descriptions of the process are available here or here and the basic steps are described below.
This guide assumes you have already have a GitHub account and have set up git on your local machine.
Fork the repository
- Login to your GitHub.com account.
- Go to the repository you wish to contribute to. The full list is at https://github.com/vivo-project. For this tutorial, we will contribute code to the main VIVO repository.
- On the repository's front page, click the 'Fork' button on the upper right.
You will now have a copy of the VIVO repository on your GitHub account.
Clone the forked repository onto your local machine
On your local machine, navigate to a convenient directory in your command line interface
Clone your forked VIVO repository. The https clone url is located on the right side of the GitHub page.
Git will download the project files into a folder named VIVO and start tracking changes. If you will be contributing again in the future, you likely want to set up your local repository to fetch code updates from the main upstream VIVO repository (not covered in this tutorial).
Create a branch
Using branches is a good idea so code changes you make are isolated from each other and can be integrated into the main code repository in separate pull requests.
If you haven't already, switch into the VIVO directory
Create a new branch, replacing 'myFeature' with a descriptive branch name
Tell GitHub about your new branch
Do your thing!
Make changes, hack away. Push your commits on your feature branch to the remote repository (your VIVO fork). As an example, I've changed robots.txt and pushed a commit to my fork.
Submit a pull request
This is where you ask the core developers to 'pull' your code changes into the main VIVO repository.
- Return to your forked repository on GitHub.com,
- Switch to your new branch
- Click the 'Pull Request' button to the right of the text that says 'This branch is n commit(s) ahead of vivo-project:master.'
- Write a description of the changes you have made
- Click Create pull request! The core developers may accept the pull request or ask you to make additional changes. If so, you can commit the changes to your feature branch without making a new pull request.
Welcome to the VIVO commit history and contributors list!