How to change CC script to Rigidbody script

I want to change this script that I wrote that allow’s my player to jump so I can use a Rigidbody on my player. The reason why I am change it is because when the player collides with a Rigidbody he get’s push I want the player to get push not the enemy (Rigidbody) I don’t know if a CC can get push.

public float jumpSpeed = 0.7f;
     public float gravity = 2;
     
     CharacterController controller;
     Vector3 currentMovement;
 
 // Use this for initialization
 void Start () 
 {
     controller = GetComponent<CharacterController>();
 }
 
 // Update is called once per frame
 void Update () 
 {
     if (!controller.isGrounded)
         currentMovement -= new Vector3 (0, gravity * Time.deltaTime, 0);
     
     else
         currentMovement.y = -9.81f;
     
     if (controller.isGrounded && Input.GetButtonDown("Jump"))
         currentMovement.y = jumpSpeed;
     
     controller.Move (currentMovement);
 }

}

Using a rigidbody instead of a character controller, is very difficult and can lead to issues down the line. If you want your player to be pushed, every time there is a collision you could check the speed and direction of the object that collided with you character controller, then use that to move your character that direction.