1570s, from French bragard (16c.), with pejorative ending (see -ard) + Middle French braguer "to flaunt, brag," perhaps originally "to show off clothes, especially breeches," from brague "breeches" (see bracket). There may be an element of codpiece-flaunting in all this.
The word in English has been at least influenced by brag (v.), even if, as some claim, it is unrelated to it. Bragger "arrogant or boastful person," agent noun from brag (v.), attested in English from late 14c.