Absalom had appointed Amasa as commander of his army, replacing Joab, who had been commander under David. (Amasa was Joab’s cousin. His father was Jether, an Ishmaelite. His mother, Abigail daughter of Nahash, was the sister of Joab’s mother, Zeruiah.)
And David told them to tell Amasa, “Since you are my own flesh and blood, like Joab, may God strike me and even kill me if I do not appoint you as commander of my army in his place.”
Then Amasa convinced all the men of Judah, and they responded unanimously. They sent word to the king, “Return to us, and bring back all who are with you.”