Ex. 5.8(a)-2 consummation of the Merger or the fulfillment of conditions of BHRB or SMMF under the Merger Agreement. 2. Covenants of Shareholder. Shareholder covenants and agrees as follows: (a) Ownership. Shareholder is the beneficial and/or...

Ex. 5.8(a)-1 EXHIBIT 5.8(a) To the Agreement and Plan of Reorganization FORM OF SMMF AFFILIATE AGREEMENT THIS AFFILIATE AGREEMENT (the “Agreement”), dated as of August 24, 2023, is by and among XXXXX & XXXXXXX FINANCIAL SERVICES CORP., a Virginia corporation (“BHRB”), SUMMIT FINANCIAL GROUP, INC., a West Virginia corporation (“SMMF”), and the undersigned shareholder of SMMF (“Shareholder”). All capitalized terms used herein and not defined herein shall have the meanings assigned thereto in the Merger Agreement (as defined herein). WHEREAS, the Boards of Directors of BHRB and SMMF have approved a business combination of their companies through the merger (the “Merger”) of SMMF with and into BHRB pursuant to the terms and conditions of an Agreement and Plan of Reorganization, dated as of August 24, 2023, by and between BHRB and SMMF, and a related Plan of Merger, a form of which is attached as an exhibit thereto (together, the “Merger Agreement”); WHEREAS, Shareholder is the beneficial and/or registered owner of, and has the sole right and power to vote or direct the disposition of the number of shares of common stock, par value $2.50 per share, of SMMF (“SMMF Common Stock”) set forth below Shareholder’s name on the signature page hereto (such shares, together with all shares of SMMF Common Stock subsequently acquired by Shareholder during the term of this Agreement and over which such Shareholder has the sole right and power to vote or direct the disposition, but excluding the shares of common stock described in the last sentence of Section 5(a) hereof, are referred to herein as the “Shares”); and WHEREAS, as a condition and inducement to BHRB and SMMF entering into the Merger Agreement, Shareholder has agreed to enter into and perform this Agreement. NOW, THEREFORE, in consideration of the covenants, representations, warranties and agreements set forth herein and in the Merger Agreement, and other good and valuable consideration (including the merger consideration set forth in ARTICLE 2 of the Merger Agreement), the receipt and sufficiency of which are acknowledged, the parties hereto, intending to be legally bound hereby, agree as follows: 1. Agreement to Vote. During the term of this Agreement and at such time as SMMF conducts the SMMF Shareholders Meeting, except as provided in Section 5(b) hereof, Shareholder agrees to vote or cause to be voted all of the Shares, and to cause any holder of record of the Shares to vote all such Shares, in person or by proxy: (i) in favor of the Merger Agreement at the SMMF Shareholders Meeting; and (ii) against (A) any Acquisition Proposal, (B) any action, proposal, transaction or agreement which could reasonably be expected to result in a breach of any covenant, representation or warranty or any other obligation or agreement of SMMF under the Merger Agreement or of Shareholder under this Agreement and (C) any action, proposal, transaction or agreement that could reasonably be expected to impede, interfere with, delay, discourage, adversely affect or inhibit the timely

Ex. 5.8(a)-6 other provisions hereof. Any provision of this Agreement held invalid or unenforceable only in part or degree shall remain in full force and effect to the extent not held invalid or unenforceable. Further, the parties agree that a court of competent jurisdiction may reform any provision of this Agreement held invalid or unenforceable so as to reflect the intended agreement of the parties hereto. [signatures on following page]