From the course: Use Git Like a Pro by Pearson
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Merging in practice
From the course: Use Git Like a Pro by Pearson
Merging in practice
Let's go back to our repository. So right now, we are on main git status. We are on main branch. Let's check the last two commits. On our main branch, We have tagDemo and tagDemo2 as our last commits. Now I'll create a new feature branch, git checkout, and I will be moving to this branch, feature-merge-demo. Let's change the file1.txt. I'll make it merge demo commit one. Let's make a commit, get add all, get commit minus M. Merge. Demo commit one. Let's make another commit. We'll use the same command, and I will use minus AM. This adds and creates commit together. Merge commit demo two. And then I do git log, and here we have the two commits. Now I'm going to merge this feature branch into main branch. For that, I will first need to move to the main branch, git checkout main. Now I do git merge, the name of the branch which I want to merge, which in my case is feed slash merge demo. Once I run this command, you must have noticed that it is a fast forward merge. The reason for that was…
Contents
-
-
-
-
-
-
-
-
(Locked)
Learning objectives1m 1s
-
(Locked)
Merging theory and concepts6m 5s
-
(Locked)
Merging in practice10m 59s
-
(Locked)
Rebase theory and concepts2m 53s
-
(Locked)
Rebase in practice10m 12s
-
(Locked)
Merging vs. rebasing3m 26s
-
(Locked)
Create pull requests19m 41s
-
(Locked)
Summary and exercise3m 36s
-
(Locked)
-
-