+#! /bin/bash
+
+# ============LICENSE_START=======================================================
+# Copyright (C) 2018 The Nordix Foundation. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+#
+# This script transfers a review with a given change id from the Nordix gerrit repository
+# to the ONAP gerrit repository. The script:
+# - switches to the master branch
+# - resets the master branch to be at the latest merged version of the master branch on the
+# Nordix gerrit repository
+# - pulls the given review onto the master branch
+# - pushes the review upstream onto the master branch of the ONAP repository
+# - resets the master branch again
+# - checks out the nordix-dev branch
+#
+
+if [ $# -ne 1 ]
+then
+ echo "usage $0 commit-id"
+ exit 1
+fi
+
+commit_check=`git log | grep "^commit $1"`
+if [ "" == "$commit_check" ]
+then
+ echo "commit with commit id $1 not found"
+ exit 2
+fi
+
+git checkout master
+git fetch origin
+git reset --hard origin/master
+
+git pull origin $1
+
+git push upstream HEAD:refs/for/master
+retVal=$?
+if [ $retVal -eq 0 ]
+then
+ echo "push upstream to ONAP succeeded"
+else
+ echo "push upstream to ONAP failed"
+fi
+
+git fetch origin
+git reset --hard origin/master
+
+git checkout nordix-dev