Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

git remote add upstream https://github.com/apache/nifi.git

 

Checkout the '

...

master' branch

git checkout -b develop master origin/developmaster will create a local, tracking branch named develop.

Why am I using 'develop' instead of 'master'? A brief summary of the Gitflow development model.

...

master.

The NiFi community uses a modified Gitflow development model.  A summary:

  • Use of a central repository
  • Branch per feature similar to the Feature Branch Workflow
  • Work is done locally and then pushed to the central repoTwo core branches are used to record the history of the project
  • 'master' - branch contains the official release history'develop' - parent branch from which feature branches are based and the target branch for completed features to be merged.  Code changes (not code formatting, administrative updates) require Review-Then-Commit (RTC) by another committer to get incorporated.

For a more in-depth guide, visit Gitflow Workflow by Atlassian as well as the original presentation of the development model by Vincent Driessen.

Perform your code changes

...

Typically, there is a 1-to-1 mapping of a branch to a backing ticket as specified in JIRA. 

Create a local branch that relates the associated JIRA issue with the branch.  Such an example would be:

git checkout -b nifi-359 developmaster

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 develop branch master 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 

...

master

$ git checkout developmaster
Switched to branch 'developmaster'
$ 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.
From https://git-wip-us.apache.org/repos/asf/nifi
a49a03d..8d745c2 developmaster -> upstream/developmaster
$ git merge upstream/developmaster
Updating a49a03d..8d745c2
Fast-forward
nifi/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 developmaster
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.

...