Build Firmware from Branch

Hello guys. I have a question about branching and firmware compilation.
Considering that I already followed the download, environment configuration, fork and clone steps.

My question is, when I branch my clone to modify a file, I commit and build the firmware with “./waf --board …” and “./waf copter”. Am I building the firmware from the branch or from my master?

I mean, I didn’t quite understand the relationship between the branch and the master when building the firmware. For example, I made a branch, modified a file, committed and built the firmware without going back to master. It’s possible? That’s how it’s done? Or do you have to merge before building and build in master?
Thank you very much in advance.

The version that gets build is the version that is checked out.

So if you’re in you branch, your branch will get compiled.

If you want to compile master you will need to checkout master

Ah ok, I understand now.

But if I want to compile the master with my modification I have to merge my branch, right? The file I modified won’t be in the master without merging it first, right?

Yes you need to either merge or cherry-pick the commit(s) with your changes.

I suggest cherry picking

Thank you! Doubts were clarified.