-
Notifications
You must be signed in to change notification settings - Fork 67
Contributions Workflow
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.
-
Fork the https://github.com/ThreatConnect-Inc/threatconnect-playbooks repo. (For instructions on how to fork a repo, please visit https://guides.github.com/activities/forking/)
-
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.
Before walking through a step-by-step process for making a contribution, here is an important principle:
- Do not make changes to the
master
branch. 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 themaster
branch clean in the sense that themaster
branch of your fork should be the same as themaster
branch 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
master
branch 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.
To view all of the branches you have in a repo, use the command: git branch
.