I have a branch X, from that one I made branch Y, and from that one I made branch Z.
I made changes in Z but not in Y. I want to bring all the changes from Z into Y and delete Z. I know it's a simple merge but I don't want to mess it up!
I have a branch X, from that one I made branch Y, and from that one I made branch Z.
I made changes in Z but not in Y. I want to bring all the changes from Z into Y and delete Z. I know it's a simple merge but I don't want to mess it up!
assuming you are on branch Z
git checkout Y
git merge Z
git branch -d Z # this will delete branch Z only if there are no new changes on Z, it is a sage delete so to say, force delete is -D (uppercase)
if branch Z
has also been pushed to remote and you also want to delete it there you need to
git push origin --delete Z
Or you could put Y where Z is and drop Z
git branch -f Y Z
git checkout Y
git branch -d Z
You need to use git merge command.
Go to branch Y : git checkout Y
Merge branch Z into Y : git merge Z
Delete branch Z : git branch -d Z
Read this for more reference : https://git-scm.com/docs/git-merge