Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
This article describes a work-flow for contributing to this project.
The steps below are a prerequisite for being able to contribute to this project.
Clone the fork to your local computer.
Run the following command to setup a remote that points to the upstream repo:
git remote add upstream https://github.com/ThreatConnect-Inc/threatconnect-playbooks.git
This will help us later when we need to update our fork with any changes that are made to the upstream repo (the one at https://github.com/ThreatConnect-Inc/threatconnect-playbooks). You can read more on this subject here.
Adding a New Playbook, Component, or App
Before walking through a step-by-step process for making a contribution, here is an important principle:
- Do not make changes to the
masterbranch. If you have something to contribute, you need to make changes on another branch (there are instructions for doing this below). You should always keep the
masterbranch clean in the sense that the
masterbranch of your fork should be the same as the
masterbranch of the upstream repo (the one at https://github.com/ThreatConnect-Inc/threatconnect-playbooks).
Now, let's get to the good stuff. Here is the process for making a contribution that you should follow every time you want to make a contribution:
Before making any changes, you need to make sure you fork is up to date with the upstream repo. To do this, run the commands below (which are documented here):
# pull any changes from https://github.com/ThreatConnect-Inc/threatconnect-playbooks git fetch upstream # checkout the master branch of your fork git checkout master # merge any changes git merge upstream/master # push the changes (OPTIONAL) git push
Now that the
masterbranch of our fork is up to date with the upstream repo, create a branch for your contribution:
git checkout -b [name_of_your_new_branch]
Make any updates you would like to contribute. Stage and commit these updates.
Once you're done making updates, push them to a branch of your fork on github:
git push origin [name_of_your_new_branch]
Finally, make a pull request from the branch of your fork on which you made the changes to the master branch of the upstream repo.
You're done! Your contribution has been received and the pull request can be reviewed.
Additional, Helpful Commands
To view all of the branches you have in a repo, use the command: