Wiki
Clone wikiUnit Class Library / Obtaining and Submitting Code for Contribution
Fork and Pull Request Model
To safeguard the code, we use the fork and pull request model. This means that to contribute code to this project, you will fork the project. You'll have your own copy of the project for editing; instead of editing the code in the main repository. After making your changes/additions in the forked project, you will create a "pull request" to merge your work into the original Unit Class Library. Your code will be reviewed by project managers before it is merged. See also this explanation from BitBucket.
Since the project you are working on is forked, feel free to branch and experiment as much as necessary!
Obtaining and Submitting Code for Contribution
We use the Fork and Pull Request Model, described above, and our underlying source version control engine is Git. Browse a Git tutorial here. You will use Git commands (or concepts, at least) in contributing to this project.
Getting the Code
Forking Unit Class Library
From the menu on the left, select the option to fork this repository. This will copy the repository to your own set of repositories. This copied repository is the one you will work within until you are ready to submit your code.
Getting the Code Locally
Once you've forked the repository, you can load it onto your local machine.To work with the code from a repository, you need to clone it to your workspace. This means that you are making a copy of the code from the repository onto your local machine. The command will follow this structure:
$ git clone <repository_url>
Submitting the Code
Getting our Updates
When you submit your code we want the only differences between your code and our code to be the changes you have made in completing your task. Therefore, before creating a pull request, you'll need to pull our updates into your code. We recommend you do this by creating a second remote location that is our repository. You can do that with this command (you need only do this once):
$ git remote add <name for remote, perhaps clearspanorigin> https://@bitbucket.org/Clearspan/unit-class-library.git
$ git pull <name for remote specified above> develop
Additionally, please build it before you generate the pull request. While our updates may not generate merge conflicts, they may cause something not to build (we may have renamed something for example).
Push Modified Code to your Repository
Once your code is ready and has integrated all our updates, you can commit and push it to your forked project.
- Add your code:
$ git add --all
- Commit your code:
$ git commit -m "<message describing your work>"
- Push your code:
$ git push
Create a Pull Request
Now your code should be up to date in your forked repository. Navigate to your forked repository and click "Create Pull Request". Check that the options are correct and describe your work. Your code will be submitted to be reviewed by the Unit Class Library managers. Thank you!
Updated