What can happen on double commit in github?

Viewed 148

I have the following situation. I was developing and I needed to deploy, on live, a commit from a while ago, let's call it commit1, but it was between other commits which I didn't want to be live. So I made a new brach and I cherry picked that commit so I can push only that one to live.

Now my question is:

When I will push another branch to live , that already has that commit1 in it, something like double commit will happen? can something go wrong in this case ?

1 Answers

Ideally, you would rebase your branch first, on top of the live branch.

The rebase process will detect the duplicated commit, and will not replay it (ie, it will be dropped) during the rebase of your commits on top of live.
Once the rebase isdone, you can push and deploy from your (rebased) branch.

Related