![]() ![]() This is because git cannot figure out the correct copy to pick for the changes to be implemented before the merge. You will likely encounter a conflict if you try to merge two files with commits that affect the same section of that file. Next let's run git merge command to finalize the process as shown below: $ git merge Ģ files changed, 0 insertions(+), 0 deletions(-)īy placing commit-A - 57dc89e into the git merge command, we have successfully merged it into the main branch on our azure_test project.ĪLSO READ: How to use git revert properly Example-3: Handling git merging conflicts Your branch is up to date with 'origin/main'. Let us pick commit-A among the displayed commits then switch back to the main branch to finalize the process using git checkoutcommand. $ git log -onelineĥ7dc89e (HEAD -> feat-branch) added another new file (commit-A)ĭ044183 (origin/main, origin/HEAD, my-branch, main) Initial commit Next, we will run the git log -oneline command to see the commit inside our now active branch feat-branch. We will switch from the main branch to feat-branch to identify a commit that we are going to merge into the main branch.įirst, we will run git checkout as illustrated below: $ git checkout feat-branch The HEAD is pointing to the main/master which implies that it is currently the active branch. It also points out the main/master remote branch. The output shows that we have two remote branches feat-branch and my-branch apart from the main branch. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |