# A GitRepository sets both ref.branch: main and ref.tag: v1.2.0. Which one does Flux check out?

Flux CD, Medium (Advanced), Concepts. https://k8wiz.com/uquiz/a-gitrepository-sets-both-refbranch-main-and-reftag-v120-which-one-does-flux-check-out

- A. The branch, because it is listed first
- B. Neither, because the object then fails API validation
- C. Whichever of the two changed most recently
- D. The tag, because tag takes precedence over branch

**Answer:** The tag, because tag takes precedence over branch

**Explanation:** When several ref fields are set, the later ones in the order branch, tag, semver, name, commit take precedence. commit pins an exact SHA and wins over everything else.
