<PAGE>
                                                                    EXHIBIT 10.2
                                                    FORM OF AFFILIATES AGREEMENT

                                 January 6, 2004

Community Bank System, Inc.
5790 Widewaters Parkway
DeWitt, New York 13214

Dear Ladies and Gentlemen:

     The undersigned is a director, executive officer and/or 10%-or-greater
shareholder of First Heritage Bank, a Pennsylvania chartered bank (the
"Company"), and is the beneficial owner (as defined in Rule 13d-3 under the
Securities Exchange Act of 1934, as amended) of such number of shares (the
"Shares") of common stock, par value $10.00 per share, of the Company ("Company
Common Stock") as is indicated on the last page hereof.

     The undersigned has been made aware that the Company, Community Bank
System, Inc., a Delaware corporation ("CBSI"), and Community Bank, N.A., a
national banking association and a wholly-owned banking subsidiary of CBSI
("CBNA"), have entered into an Agreement and Plan of Merger (the "Merger
Agreement"), providing for the merger of the Company with and into CBNA (the
"Merger"). In order to induce CBSI and CBNA to consummate the Merger, the
undersigned agrees and undertakes, in his or her capacity as a shareholder of
the Company, as follows:

     1. Covenants under Rule 145.

          (a) The undersigned has been advised that the issuance of shares of
common stock, no par value, of CBSI issuable to the undersigned pursuant to the
Merger ("CBSI Common Shares") will be registered under the Securities Act of
1933, as amended (the "Securities Act"), pursuant to a registration statement on
Form S-4 (the "Registration Statement"). The undersigned has also been advised
that the undersigned may be deemed an "affiliate" of the Company at the time the
Merger is submitted to a vote of the shareholders of the Company, as the term
"affiliate" is used in Rule 145 under the Securities Act, and as such, will be
subject to Rule 145 promulgated under the Securities Act. Accordingly, the
undersigned agrees that, subject to CBSI's compliance with its obligations
herein, he or she will not sell or otherwise dispose of any CBSI Common Shares,
except (i) in accordance with Rule 145(d) promulgated under the Securities Act,
(ii) at such time as a registration statement under the Securities Act covering
resales of such CBSI Common Shares is effective, or (iii) in a transaction
which, in the opinion of counsel reasonably satisfactory to CBSI (which opinion
may, but need not, be based upon a "no-action" or interpretative letter from the
staff of the SEC), is not required to be registered under the Securities Act.

          Generally speaking, this means that, in any given three month period
the undersigned may not sell or otherwise dispose of a number of CBSI Common
Shares which exceeds the greater of (i) 1% of the then outstanding number of
CBSI Common Shares, or (ii) the

<PAGE>

average weekly trading volume of CBSI Common Shares during the four weeks
preceding the sale. In addition, any CBSI Common Shares must be sold in a
brokers' transaction or in a direct transaction with a market maker. The
restrictions discussed in this paragraph are only applicable for a one year
period following the closing of the Merger, unless the undersigned becomes an
"affiliate" of CBSI as a result of the Merger or otherwise, in which case the
undersigned will continue to be subject to similar restrictions under Rule 144
promulgated under the Securities Act until at such time as Rule 144(k) becomes
applicable.

          (b) The undersigned understands and agrees that: (i) CBSI is under no
obligation to register the sale, transfer or other disposition of the CBSI
Common Shares under the Securities Act and any applicable state securities laws,
except pursuant to the Registration Statement which will cover only the primary
issuance of the CBSI Common Shares in the Merger; (ii) stop transfer
instructions will be given to the transfer agent of CBSI with respect to the
CBSI Common Shares and there will be placed on the certificate(s) representing
such stock, or any certificate(s) delivered in substitution therefor, a legend
stating in substance:

          "THE SECURITIES REPRESENTED BY THIS CERTIFICATE WERE ISSUED IN A
          TRANSACTION TO WHICH RULE 145 UNDER THE SECURITIES ACT OF 1933 (THE
          "ACT") APPLIES. THE SECURITIES REPRESENTED BY THIS CERTIFICATE MAY BE
          TRANSFERRED ONLY IN ACCORDANCE WITH RULE 145(d) OR PURSUANT TO AN
          EFFECTIVE REGISTRATION STATEMENT OR EXEMPTION FROM REGISTRATION UNDER
          THE ACT."

Unless the transfer by the undersigned is a sale made in conformity with the
provisions of Rule 145(d), or is made pursuant to a registration statement under
the Securities Act or the stop transfer instructions or legends have previously
been terminated or removed, CBSI reserves the right to put an appropriate
Securities Act legend on the certificate issued to a transferee of the
undersigned. CBSI agrees that the stop transfer instructions shall be promptly
terminated and the legend referred to above removed by delivery of substitute
certificates without such legend and the issuance of a letter to CBSI's transfer
agent removing such stop transfer instructions, and the above restrictions on
sale will cease to apply, if (i) two years (or such other period as may be
required by Rule 145(d)(3) under the Securities Act or any successor thereto)
shall have elapsed from the date on which the Effective Time occurs, and the
provisions of such Rule are then available to the undersigned; or (ii) the
undersigned shall have delivered to CBSI (A) a copy of a letter from the staff
of the Commission, or an opinion of counsel experienced in securities law
matters, in form and substance reasonably satisfactory to CBSI or other evidence
reasonably satisfactory to CBSI, to the effect that such legend and/or stop
transfer instructions are not required for purposes of the Securities Act or (B)
reasonably satisfactory evidence or representations that the securities
represented by such certificates are being or have been transferred in a
transaction made in conformity with the provisions of Rule 145 under the
Securities Act or pursuant to an effective registration statement under the
Securities Act.

     Until such time as the stop transfer instructions and legends contemplated
by this Agreement have been terminated and removed, CBSI shall, at its sole
expense, cause to be provided to the transfer agent, upon written request by and
on behalf of the undersigned, an

                                       2

<PAGE>

opinion of counsel, within 48 hours after all documents and representations
reasonably requested as necessary or appropriate have been delivered to counsel,
confirming the ability of the undersigned to sell, assign or otherwise dispose
of any CBSI Common Shares without registration under the Securities Act in
reliance upon Rule 145 or pursuant to an effective registration statement under
the Securities Act (or if such opinion of counsel is not provided within such
time period, then CBSI shall promptly reimburse the undersigned for the
reasonable cost of the undersigned's obtaining such an opinion from its own
counsel), provided that (i) such proposed transaction can in fact be effected in
compliance with Rule 145 or pursuant to an effective registration statement, and
(ii) the undersigned provides to such counsel any representations reasonably
deemed necessary or appropriate by such counsel to render such an opinion.

     2. Termination. This Agreement shall terminate and shall have no further
force or effect only as of such date and time as the Merger Agreement shall have
been terminated pursuant to its terms.

     3. Remedies. The undersigned acknowledges and agrees that any remedy at law
for breach of the foregoing provisions shall be inadequate and that, in addition
to any other relief which may be available, CBSI shall be entitled to seek
temporary and permanent injunctive relieve without the necessity of proving
monetary damages or posting a bond.

     4. Enforcement. The undersigned represents that he or she has the capacity
to enter into this Agreement and that it is a valid and binding obligation
enforceable against the undersigned in accordance with its terms, subject to
bankruptcy, insolvency and other laws affecting creditor's rights and general
equitable principles.

     5. Severability. If any term, provision, covenant or restriction of this
Agreement is held by a court of competent jurisdiction to be invalid, void or
unenforceable, then the remainder of the terms, provisions, covenants and
restrictions of this Agreement shall remain in full force and effect and shall
in no way be affected, impaired or invalidated.

     6. Current Public Information. CBSI agrees, by accepting this letter, that
for a period of two years after the Effective Time of the Merger (or such other
period as may be required by Rule 145) and thereafter three months after the
undersigned ceases to be an affiliate of CBSI (if applicable) CBSI will make
publicly available with respect to itself "adequate current public information"
as defined in paragraph (c) of Rule 144 under the Securities Act.

     7. No Admission. Execution of this letter shall not be construed as an
admission on the undersigned's part that he or she is an "affiliate" of the
Company as described in this letter or as a waiver of any rights that
undersigned may have to object to any claim that the undersigned is such an
affiliate on or after the date of this letter.

                [REMAINDER OF THIS PAGE INTENTIONALLY LEFT BLANK]

                                       3

<PAGE>

     IN WITNESS WHEREOF, the undersigned has executed this Agreement as of the
date of first above written.

                                             Very truly yours,

                                             ___________________________________

                                             Name:______________________________

                                             ________ shares of the Company
                                             Common Stock Owned.

Accepted and agreed to as of
the date first above written:


COMMUNITY BANK SYSTEM, INC.


By:___________________________________
   Name:  Sanford A. Belden
   Title: President and Chief Executive Officer

                                       4