"foresail of a ship," 1660s, gibb, of uncertain origin, perhaps related to gibbet, from notion of a sail "hanging" from a masthead [Barnhart, OED]. Or perhaps from jib (v.) "shift a sail or boom" (1690s), from Dutch gijben, apparently related to gijk "boom or spar of a sailing ship." Said to indicate a ship's character to an observant sailor as a strange vessel approaches at sea; also nautical slang for "face," hence cut of (one's) jib "personal appearance" (1821).
"agree, fit," 1813, of unknown origin, perhaps a figurative extension of earlier jib, gybe (v.) "shift a sail or boom" (see jib). OED, however, suggests a phonetic variant of chime, as if meaning "to chime in with, to be in harmony." Related: Jibed; jibes; jibing.
1560s, perhaps from Middle French giber "to handle roughly," or an alteration of gaber "to mock."