I think that the only way you could do this would be to delete and re-import the field groups each time.
ACF does only read from the JSON if it exists, but not when editing a field group. In this case it only reads from the database. But ACF will write to the JSON files when you update including all fields that are in the database for the group. I don’t know that there is any way to prevent ACF from doing this or doing what you want.
1) Create Branch
2) Delete all of the field groups, maybe just the ones changed in some other branch)
3) Import the effected field groups, You can import them directly from the ACF JSON folder. Also, I think, but I’m not sure, that field groups that are in the acf-json folder but do not exist in the database may be available for sync.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.