I made some changes in my local repository and pushed those in the remote branch, when I created a Pull Request for the same, I noticed that the branch contains all the commits I have made against the master, going back to 3 months. I also got the message that I am "52 commits behind the master" which I am assuming is because my code is not merged with the master (Please let me know if I am wrong in this assumption). I wanted only the latest commit to go to the branch I have created. One of options I thought about was pushing the specific commit to a new branch and then create a PR for it against the master, but it seems all the commits will be pushed till the specific commit unless I change the order using rebase.
I wanted to know what would be the better option, sync the commits or change the order using rebase and then push only that specific commit to the local branch?
Any help would be appreciated Note:I have recently started using git(bitbucket) and I'm struggling to grasp it and don't want to mess things up with the companies code, so there is a good chance that this question might not make sense.
I have tried to push the latest commit to the remote branch, but it seems to push all the commits till the latest commit. One of the option is to use rebase, but I am not really sure how I do it and whether it should be used.