GIT - Can I combine a branch with a specific commit

I currently have a UAT branch and a main branch. I merge the UAT branch into Master on a weekly basis (after a weekly release).

I stupidly checked in another element on the UAT before doing the merge.

Can I do something like this:

git merge uat 4d9ed3b8122a215f64f07028c92bb0cb0a8b4570

So will this merge the UAT with this commit?

+4
source share
1 answer

A git branch is just a pointer to a commit. So you can definitely ignore the fact that the commit you want is somewhere behind the branch uat, and just do it (from the master):

git merge 4d9ed3b8122a215f64f07028c92bb0cb0a8b4570

master ( commit) 4d9ed3b8122a215f64f07028c92bb0cb0a8b4570.

+8

Source: https://habr.com/ru/post/1607781/


All Articles