Versions Compared

Key

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

...

Expand
titleHow to resolve repo sync failures when the branch is few commits behind the master or when it has uncommitted changes?
  • Sometimes when you have a working branch which is not checked out or has uncommitted changes then repo will fail when you try to sync to the latest code base.
  • Sample failure logs:

error: generic/devicesettings/generic/: contains uncommitted changes

error: generic/rdkbrowser/: branch master is published (but not merged) and is now 11 commits behind

error: meta-rdk-oem-X/: contains uncommitted changes

  • To resolve this you need to checkout the branch and rebase it to the master using below commands.

git rebase —abort

git rebase rdkgerrit/master ( or rdkgerrit/stable2)

  • During the process git might throw conflict errors if it cannot merge files automatically. Then you need to merge manually using Vim or any other text editors. But it can be simple if you know exactly what changes needs to be saved / removed.
  • For example you can use below command to keep your changes

git checkout --ours FILE

  • If you want to run on multiple files then use below command.

grep -lr ‘<<<<<<<<’.  |  xargs git checkout --ours

  • Similarly,  you can use below commands if you want to keep other changes.

git checkout --yours FILE

grep -lr ‘<<<<<<<<’.  |  xargs git checkout –theirs

...

Expand
titleHow to enable or disable any feature using macro?

Please refer Compile-time Build Variants Flags

...