In order to achieve this, you should have got the upstream repo imported to Nordix Gerrit so you can do your work in a repo cloned from Nordix.
Uplift a Team Branch
Use this procedure to uplift (merge) the nordix-dev branch after your changes have been merged in to the ONAP repo and synched back to the nordix master branch.
- Fetch latest changes from central repo.
- Create a temporary branch based on the latest remote
git checkout -b nordix-dev_temp origin/nordix-dev
- Perform the merge.
git merge origin/master
- Depending on whether you encounter merge conflicts or not:
If there are conflicts you will have to solve them before continuing:
Remember to clean up the commit message (the default one provided by Git is not recommended)!
The git status command has no practical effect, but it's always good to run to keep track of what is happening.
- If there are no merge conflicts Git will automatically commit the merge, but you should amend commit message (the default one provided by Git is not recommended):
git commit --amend
Running the git commit command also has the effect that a change-id is added to the commit message (if not present already). And you need a change-id to be able to push a commit for review.
- Send uplift for review and to run verification
git push origin HEAD:refs/for/task/<owner>/<branch>
- Go back to team branch.
git checkout task/<owner>/<branch>.
- Remove temporary branch
git branch –d task/<owner>/<branch>_temp
The repos are automatically kept in synch.
When automatic rebase fails
- Fetch the latest changes for all branches from central Nordix repo to local repo.
- Make sure that latest commit on Nordix master is the same as the latest one on ONAP master. If not, send a mail to the "discuss" mailing list that there might be something wrong with the synch job.
- Create a temporary branch
git checkout -B temp_rebase_branch origin/master
- Get the change from Gerrit by using the cherry-pick link on the Gerrit review page in Nordix.
git fetch https://gerrit.onap.org/r/dcaegen2/collectors/datafile refs/changes/69/67269/2 && git cherry-pick FETCH_HEAD
- Resolve the rebase conflicts
git cherry-pick --continue
- Resubmit to master in ONAPNordix
git push usptream HEAD:refs/for/master
- Move to another branch so the temporary rebase branch can be deleted (git branch shows you the branches you have which you can move to)
git checkout <some other branch>
- Remove the temporary local delivery branch
git branch –D temp_rebase_branch