The Geshurites in view were not the people that came from the Geshur which was situated in the north (see 2 Samuel 3:3; 2 Samuel 13:37–38), but another Geshur that was in the southern region between Judah and Egypt. These people were associated with the Philistines in Joshua 13:2.
8 Now David and his men went up and made raids against the Geshurites, the Girzites, and the Amalekites, for these were the inhabitants of the land from of old, as far as Shur, to the land of Egypt.