You are viewing documentation for Flux version: 2.1
Version 2.1 of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.
Proposing changes
git
locally.Getting started
- Familiarize yourself with the documentation repository and the website’s static site generator (Hugo).
- Understand the process for opening a pull request and reviewing changes
Opening a pull request
To contribute new pages or improve existing pages, open a pull request (PR).
If your change is small, or you’re unfamiliar with git, read Changes using GitHub.
Changes using GitHub
If you’re less experienced with git workflows, here’s an easier method of opening a pull request.
Maintainer Warning
If you are a maintainer of the repo, the edit page button will not let you work off a fork, as you have write permission.On the page you want to modify, select the pencil icon at the top right.
Make your changes in the GitHub markdown editor.
Below the editor, fill in the Propose file change form.
In the first field, give your commit message a title. In the second field provide a description
Warning
Do not use any GitHub Keywords in your commit message. You can add those to the pull request description later.Select Propose file change.
Select Create pull request.
The Open a pull request screen appears. Fill in the form:
- The Subject field of the pull request defaults to the commit summary. You can change it if needed.
- The Body contains your extended commit message, if you have one, and some template text. Add the details the template text asks for, then delete the extra template text.
- Leave the Allow edits from maintainers checkbox selected.
PR descriptions are a great way to help reviewers understand your change. For more information, see Opening a PR.Select Create pull request.
Addressing feedback in GitHub
Before merging a pull request, community members review and approve it.
If a reviewer asks you to make changes:
- Go to the Files changed tab.
- Select the pencil (edit) icon on any files changed by the pull request.
- Make the changes requested.
- Commit the changes.
Work from a local fork
If you’re more experienced with git, or if your changes are larger than a few lines, work from a local fork.
Fork the fluxcd/website repository
Navigate to the
fluxcd/website
repository.Select Fork.
Navigate to the new
website
directory. Set thefluxcd/website
repository as theupstream
remote:cd website git remote add upstream https://github.com/fluxcd/website.git
Confirm your
origin
andupstream
repositories:git remote -v
Output is similar to:
origin git@github.com:<github_username>/website.git (fetch) origin git@github.com:<github_username>/website.git (push) upstream https://github.com/fluxcd/website.git (fetch) upstream https://github.com/fluxcd/website.git (push)
Fetch commits from your fork’s
origin/main
andfluxcd/website
’supstream/main
:git fetch origin git fetch upstream
This makes sure your local repository is up to date before you start making changes.
Create a new branch based on
upstream/main
:git checkout -b <my_new_branch> upstream/main
Make your changes using a text editor.
At any time, use the git status
command to see what files you’ve changed.
Commit your changes
When you are ready to submit a pull request, commit your changes.
In your local repository, check which files you need to commit:
git status
Output is similar to:
On branch <my_new_branch> Your branch is up to date with 'origin/<my_new_branch>'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: content/en/contribute/new-content/run-locally.md no changes added to commit (use "git add" and/or "git commit -a")
Add the files listed under Changes not staged for commit to the commit:
git add <your_file_name>
Repeat this for each file.
After adding all the files, create a commit:
git commit -sm "Your commit message"
Do not use any GitHub Keywords in your commit message. You can add those to the pull request description later.Push your local branch and its new commit to your remote fork:
git push origin <my_new_branch>
Open a pull request from your fork to fluxcd/website
- In a web browser, go to the
fluxcd/website
repository. - Navigate to pull requests and select New pull request
- Select compare across forks
- From the head repository drop-down menu, select your fork.
- From the compare drop-down menu, select your branch.
- Select Create Pull Request.
- Add a description for your pull request:
- Title (50 characters or less): Summarize the intent of the change.
- Description: Describe the change in more detail.
- If there is a related GitHub issue, include
Fixes #12345
orCloses #12345
in the description. GitHub’s automation closes the mentioned issue after merging the PR if used. If there are other related PRs, link those as well. - If you want advice on something specific, include any questions you’d like reviewers to think about in your description.
- If there is a related GitHub issue, include
- Select the Create pull request button.
Congratulations! Your pull request is available in Pull requests.
Addressing feedback locally
After making your changes, amend your previous commit:
git commit -as --amend
-as
: commits all changes and adds your signoff--amend
: amends the previous commit, rather than creating a new one
Update your commit message if needed.
Use
git push origin <my_new_branch>
to push your changes and re-run the Netlify tests.
Changes from reviewers
Sometimes reviewers commit to your pull request. Before making any other changes, fetch those commits.
Fetch commits from your remote fork and rebase your working branch:
git fetch origin git rebase origin/<your-branch-name>
After rebasing, force-push new changes to your fork:
git push --force-with-lease origin <your-branch-name>
Adding DCO on commits retroactively
Open an interactive rebase session
git rebase --signoff HEAD~<number of commits in your pr>
Verify you have signed the commits
git log
Force push
git push -f origin branchname
Merge conflicts and rebasing
#sig-docs
Slack channel for help.If another contributor commits changes to the same file in another PR, it can create a merge conflict. You must resolve all merge conflicts in your PR.
Update your fork and rebase your local branch:
git fetch origin git rebase origin/<your-branch-name>
Then force-push the changes to your fork:
git push --force-with-lease origin <your-branch-name>
Fetch changes from
fluxcd/website
’supstream/main
and rebase your branch:git fetch upstream git rebase upstream/main
Inspect the results of the rebase:
git status
This results in a number of files marked as conflicted.
Open each conflicted file and look for the conflict markers:
>>>
,<<<
, and===
. Resolve the conflict and delete the conflict marker.For more information, see How conflicts are presented.Add the files to the changeset:
git add <filename>
Continue the rebase:
git rebase --continue
Repeat steps 2 to 5 as needed.
After applying all commits, the
git status
command shows that the rebase is complete.Force-push the branch to your fork:
git push --force-with-lease origin <your-branch-name>
The pull request no longer shows any conflicts.