Today I want to show you how easy it is to merging branches, fix a merge conflict and how to use cherry-pick to get any commit your local branch!
Let’s get fired up and hit the terminal 🔥
In the video, I show you everything that I know. Below the video, you can check the notes with all the commands you need.
Make sure your both branches are up to date on the remote!
git merge tryout
Now you can test if your code still works! If it works it push it to the remote!
Use the following command like we talked about in the previous video, to delete the branch.
git branch -d tryout
Sometimes it happens that someone else changed the same row as you did. When you pull the remote you will get a merge conflict.
The easiest way to fix this is just manually by checking your code. After you fixed it, commit this change and push it to the remote!
This is what we called cherrypicking. With cherry-pick you can pick the commit you want, to pull it into your local branch where your working on.
Just find the commit id and just this command.
git cherry-pick commitId
If your working with Git, but getting stuck? Please let me know in the comments or hit me on twitter @frontendmr and I would ❤️ to help you out!
Did you liked this post? Please share it around 🙏
Originally published at Mr Frontend Blog.