Table of Contents
- Fork a repository
- Clone fork repository to local
- Create a branch to add a new feature or fix issues
- Commit and Push
- Create a Pull Request
The fluentd code is hosted on Github (https://github.com/fluent/fluentd). The repository is called upstream
. Contributors will develop and commit their changes in a clone of upstream repository. Then contributors push their change to their forked repository (origin
) and create a Pull Request (PR), the PR will be merged to upstream
repository if it meets the all the necessary requirements.
Go to https://github.com/fluent/fluentd then hit the Fork
button to fork your own copy of repository fluentd to your github account.
Clone the forked repo in above step to your local working directory:
$ git clone https://github.com/$your_github_account/fluentd.git
Keep your fork in sync with the main repo, add an upstream
remote:
$ cd fluentd
$ git remote add upstream https://github.com/fluentd/fluentd.git
$ git remote -v
origin https://github.com/$your_github_account/fluentd.git (fetch)
origin https://github.com/$your_github_account/fluentd.git (push)
upstream https://github.com/fluentd/fluentd.git (fetch)
upstream https://github.com/fluentd/fluentd.git (push)
Sync your local master
branch:
$ git checkout master
$ git pull origin master
$ git fetch upstream
$ git rebase upstream/master
Before making any change, create a new branch:
$ git checkout master
$ git pull upstream master
$ git checkout -b new-feature
Make any change on the branch new-feature
then build and test your codes.
Include in what will be committed:
$ git add <file>
Commit your changes with sign-offs
$ git commit -s
Enter your commit message to describe the changes. See the tips for a good commit message at here.
Likely you go back and edit/build/test some more then git commit --amend
Push your branch new-feature
to your forked repository:
$ git push -u origin new-feature
- Go to your fork at https://github.com/$your_github_account/fluentd
- Create a Pull Request from the branch you recently pushed by hitting the button
Compare & pull request
next to branch name.