53. Working Through Git Merge Conflicts - Full stack web development Course
6.4 هزار بار بازدید -
6 سال پیش
-
In this Full Stack Web
In this Full Stack Web Development Tutorial Course video, We are going to talk about #git #merge #conflicts.
What is merge conflict?
A merge conflict is an event that occurs when Git is unable to automatically resolve differences in code between two commits. When all the changes in the code occur on different lines or in different files, Git will successfully merge commits without your help.
What causes a merge conflict in git?
When all the changes in the code occur on different lines or in different files, Git will successfully merge commits without your help. However, when there are conflicting changes on the same lines, a “merge conflict” occurs because Git doesn't know which code to keep and which to discard.
How to resolve merge conflicts in git?
- Open Terminal .
- Navigate into the local Git repository that has the merge conflict.
- Generate a list of the files affected by the merge conflict.
- Open your favourite text editor, such as Atom, and navigate to the file that has merge conflicts.
- Decide if you want to keep the removed file. You may want to view the latest changes made to the removed file in your text editor.
- To add the removed file back to your repository:
$ git add README.md
- To remove this file from your repository:
$ git rm README.md
- README.md: needs merge
rm 'README.md'
- Commit your changes with a comment.
$ git commit -m "Resolved merge conflict by keeping README.md file."
----------------------------
Week 2 : Day 2
Section 6 : Version Control With Git
Tutorial 53: Working Through Git Merge Conflicts
----------------------------
Do subscribe and hit Bell Icon
----------------------------
Follow us in social media handles for opportunities and code related support.
Instagram: Instagram: wb.web
Facebook: Facebook: wbweb
Twitter: Twitter: wbweb_in
LinkedIn: LinkedIn: wbweb
----------------------------
Got a question on the topic? Please share it in the comment section below and our experts will answer it for you.
For more information, please write back to us at [email protected] or call us at: 7077568998
After completing the course, write to [email protected] for internship or freelancing opportunities.
What is merge conflict?
A merge conflict is an event that occurs when Git is unable to automatically resolve differences in code between two commits. When all the changes in the code occur on different lines or in different files, Git will successfully merge commits without your help.
What causes a merge conflict in git?
When all the changes in the code occur on different lines or in different files, Git will successfully merge commits without your help. However, when there are conflicting changes on the same lines, a “merge conflict” occurs because Git doesn't know which code to keep and which to discard.
How to resolve merge conflicts in git?
- Open Terminal .
- Navigate into the local Git repository that has the merge conflict.
- Generate a list of the files affected by the merge conflict.
- Open your favourite text editor, such as Atom, and navigate to the file that has merge conflicts.
- Decide if you want to keep the removed file. You may want to view the latest changes made to the removed file in your text editor.
- To add the removed file back to your repository:
$ git add README.md
- To remove this file from your repository:
$ git rm README.md
- README.md: needs merge
rm 'README.md'
- Commit your changes with a comment.
$ git commit -m "Resolved merge conflict by keeping README.md file."
----------------------------
Week 2 : Day 2
Section 6 : Version Control With Git
Tutorial 53: Working Through Git Merge Conflicts
----------------------------
Do subscribe and hit Bell Icon
----------------------------
Follow us in social media handles for opportunities and code related support.
Instagram: Instagram: wb.web
Facebook: Facebook: wbweb
Twitter: Twitter: wbweb_in
LinkedIn: LinkedIn: wbweb
----------------------------
Got a question on the topic? Please share it in the comment section below and our experts will answer it for you.
For more information, please write back to us at [email protected] or call us at: 7077568998
After completing the course, write to [email protected] for internship or freelancing opportunities.
6 سال پیش
در تاریخ 1397/03/08 منتشر شده
است.
6,404
بـار بازدید شده