450 likes | 482 Views
This video on Git Merge Conflict will help you understand the concept of Git Merge Conflicts. We will begin with understanding some basic Git commands. Then we shall focus on the Git Merge conflict in which we shall see the type of merge conflicts and how that conflict can be resolved. Towards the end, we shall see the commands required to resolve the conflict. Finally, to have a better understanding of the Git Merge Conflict and how to solve it, we shall see a hands-on demo. <br><br>The below topics will be explained in this presentation: <br>1. What is Git?<br>2. Basic Git commands<br>3. What is a merge conflict<br>4. Types of merge conflicts<br>5. How to resolve merge conflicts? <br>6. Git commands to resolve conflicts<br>7. Demo<br><br><br>Learn the basics of Gitu2014a version control system (VCS), and understand how to set up Git in your system, list the three-stage workflow in Git, create branches and track files, create repository in Git, GitHub and more.<br><br>Whatu2019s the focus of this course?<br>Git is a version control system (VCS) for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for software development, but it can be used to keep track of changes in any files.This course enables you to learn and solve versioning problems with your files and codes. All these concepts are presented in an easy to understand manner, using demos and assignments to clarify the concepts and present the actual method of implementation.<br><br>What are the course objectives?<br>- Git course offered by Simplilearn will enable you to:<br>- Understand distributed version control system and its features<br>- Set-up Git in your system<br>- List the three-stage workflow in Git<br>- Create branches and track files<br>- Create a repository in Git and GitHub<br>- Describe merging, cloning, rebasing, among others<br><br>Who should take this course?<br>- The following professionals can go for this course:<br>- Software Professionals<br>- Testing Professionals<br>- Software Architects and Designers<br>- Open source contributors and enthusiasts<br>- Developers who want to gain acceleration in their careers as professionals using Git and GitHub<br>- Managers who are technical subject matter experts, leading software development projects<br><br>ud83dudc49Learn more at: https://bit.ly/3f7UQh0<br>
E N D
What’s in it for you? What is Git? Basic Git commands What is a merge conflict? Types of merge conflicts How to resolve merge conflicts? Git commands to resolve conflicts Demo
What is Git? • Git is a version control system for tracking changes in computer files. It is used for coordinating work among several people on a project and tracking progress over time • It is used for Source Code Management in software development
What is Git? • Git favors both programmers and non-technical users by keeping track of their project files
What is Git? • Git favors both programmers and non-technical users by keeping track of their project files • It allows multiple users to work together
What is Git? • Git favors both programmers and non-technical users by keeping track of their project files • It allows multiple users to work together • Large projects can be handled efficiently
Basic commands in Git Git config Configure the username and email address
Basic commands in Git Git config Configure the username and email address Git init Initialize a local Git repository
Basic commands in Git Git config Configure the username and email address Git init Initialize a local Git repository Git add Add one or more files to staging area
Basic commands in Git Git config Configure the username and email address Git init Initialize a local Git repository Git add Add one or more files to staging area View the changes made to the file Git diff
Basic commands in Git Git config Configure the username and email address Git init Initialize a local Git repository Git add Add one or more files to staging area View the changes made to the file Git diff Git commit Commit changes to head but not to the remote repository
Basic commands in Git Git reset Undo local changes to the state of a Git repo
Basic commands in Git Git reset Undo local changes to the state of a Git repo Git status Displays the state of the working directory and staging area
Basic commands in Git Git reset Undo local changes to the state of a Git repo Git status Displays the state of the working directory and staging area Git merge Merge a branch into an active branch
Basic commands in Git Git reset Undo local changes to the state of a Git repo Git status Displays the state of the working directory and staging area Git merge Merge a branch into an active branch Git push Upload content from local repository to a remote repository
Basic commands in Git Git reset Undo local changes to the state of a Git repo Git status Displays the state of the working directory and staging area Git merge Merge a branch into an active branch Git push Upload content from local repository to a remote repository Git pull Fetch and download content from a remote repository
What is merge conflict?
What is a merge conflict? Pull Pull Push Push Merge conflict
What is a merge conflict? To prevent such conflicts developers work in separate isolated branches. The Git merge command combines separate branches and resolves any conflicting edits Pull Pull Push Push Merge conflict
What is a merge conflict? • A merge conflict is an event that takes place when Git is unable to resolve differences in code between the two commits automatically • Git can automatically merge the changes only if the commits are on different lines or branches Pull Pull Push Push Merge conflict
Types of merge conflicts
Types of merge conflicts There are two points when a merge can enter a conflicted state
Types of merge conflicts There are two points when a merge can enter a conflicted state Starting the merge process • If there are changes in the working directory of the stage area of the current project, merge will fail to start • In this case conflicts happen due to pending changes which need to be stabilized using different Git commands
Types of merge conflicts There are two points when a merge can enter a conflicted state Starting the merge process During the merge process • If there are changes in the working directory of the stage area of the current project, merge will fail to start • In this case conflicts happen due to pending changes which need to be stabilized using different Git commands • The failure during the merge process indicates that there is a conflict between the local branch and the branch being merged • In this case Git resolves as much as possible but there are things that have to be resolved manually in the conflicted files
How to resolve merge conflicts? The most simple way to resolve the conflicted file is to open it and make the required changes to it
How to resolve merge conflicts? The most simple way to resolve the conflicted file is to open it and make the required changes to it After editing the file we can use the git add command to stage the new merged content
How to resolve merge conflicts? The most simple way to resolve the conflicted file is to open it and make the required changes to it After editing the file we can use the git add command to stage the new merged content The final step is to create a new commit with the help of the git commit command
How to resolve merge conflicts? The most simple way to resolve the conflicted file is to open it and make the required changes to it After editing the file we can use the git add command to stage the new merged content The final step is to create a new commit with the help of the git commit command Git will create a new merge commit to finalize the merge
Git commands to resolve conflicts git log --merge git log --merge command helps in producing the list of commits that are causing the conflict
Git commands to resolve conflicts git log --merge git log --merge command helps in producing the list of commits that are causing the conflict git diff git diff command helps in finding the differences between the states of repositories or files
Git commands to resolve conflicts git log --merge git log --merge command helps in producing the list of commits that are causing the conflict git diff git diff command helps in finding the differences between the states of repositories or files git checkout git checkout command is used to undo the changes made to the file, or for changing branches
Git commands to resolve conflicts git reset --mixed git reset –mixed command is used to undo the changes to the working directory and staging area
Git commands to resolve conflicts git reset --mixed git reset –mixed command is used to undo the changes to the working directory and staging area git merge --abort git merge --abort command helps in exiting the merge process and returning back to the state before the merging began
Git commands to resolve conflicts git reset --mixed git reset –mixed command is used to undo the changes to the working directory and staging area git merge --abort git merge --abort command helps in exiting the merge process and returning back to the state before the merging began git reset git reset command is used at the time of merge conflict to reset the conflicted files to their original state