How to compile specific branch of electron?

What is the proper way to compile specific branch on electron?, for example “5-0-x” electron branch?.

Does the following gclient command is the right way? :

gclient config --name "src/electron" --unmanaged https://github.com/electron/electron.git@refs/remotes/origin/5-0-x
gclient sync --with_branch_heads --with_tags -v