git remote add upstream https://github.com/apache/nifi.git
Checkout the '
main' or '1.x.0' branch
git checkout -b master origin/master will
main origin/main will create a local, tracking branch named
git checkout -b 0.x origin/1.x.0 will create a local, tracking branch named 1
The master branch main branch currently represents the next major release line (1.x.0).
- Use of a central repository
- Branch per feature similar to the Feature Branch Workflow
- Work is done locally and then pushed to the central repo
- 'mastermain' branch contains the official release history. Code changes (not code formatting, administrative updates) require Review-Then-Commit (RTC) by another committer to get incorporated.
Create a local branch that relates the associated JIRA issue with the branch. Such an example would be:
git checkout -b nifi-359 mastermain
This provides instant traceability to the supporting issue and provides a means of linking discussion.
If you are working on a branch over an extended period of time, it helps to keep your code current with the master branch main branch to ensure your changes are applied as anticipated and to facilitate the merging process.
This is best accomplished through the
git rebase functionality. There are many ways in which
git rebase can be utilized in this context of branching and rebasing. Typically, the command to do so is performed from your feature branch. Continuing on with the sample of NIFI-359, we will show one way of accomplishing this task.
Update your local copy of
$ git checkout mastermain
Switched to branch 'mastermain'
$ git fetch upstream
remote: Counting objects: 52, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 16 (delta 7), reused 0 (delta 0)
Unpacking objects: 100% (16/16), done.
a49a03d..8d745c2 mastermain -> upstream/mastermain
$ git merge upstream/mastermain
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/java/org/apache/nifi/cluster/protocol/StandardDataFlow.java | 27 ++++++++++-----------------
1 file changed, 10 insertions(+), 17 deletions(-)
$ git checkout nifi-359
Switched to branch 'nifi-359'
$ git rebase mastermain
First, rewinding head to replay your work on top of it...
Applying: NIFI-359: Removing the output to System.out and providing some simple checks to ensure extraction of attributes is consistent with the sample file used in the test.