-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add : How To Merge and Resolve Conflicts
- Loading branch information
1 parent
c855eb0
commit 6ccac46
Showing
7 changed files
with
212 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,111 @@ | ||
|
||
|
||
### Tips - 21 | ||
|
||
<h2><span style="color:#7A316F;font-weight:700;font-size:25px"> | ||
How To Add Video, Audio and GIFs Files directly in README.md File | ||
### Tips - 23 | ||
|
||
<h2><span style="color:#F6635C;font-weight:700;font-size:25px"> | ||
🎅 How to Resolving Merge Conflicts ? | ||
</span></h2> | ||
|
||
#### 🎥 Add Videos on README.md File: **([👉Click Here](https://www.geeksforgeeks.org/how-to-add-videos-on-readme-md-file-in-a-github-repository/?ref=lbp))** | ||
#### 🎥 Tutorial Resolving Merge Conflicts (With Example): **([👉Click Here](https://youtu.be/nfOxUaA2trY))** | ||
|
||
|
||
|
||
![](Images/m5.png) | ||
![](Images/m6.png) | ||
![](Images/m7.png) | ||
|
||
|
||
#### 🤧 What is a Git Merge Conflict? | ||
A merge conflict is an event that takes place when Git is unable to automatically resolve differences in code between two commits. Git can merge the changes automatically only if the commits are on different lines or branches. | ||
|
||
The following is an example of how a Git merge conflict works: | ||
|
||
![](Images/m4.jpeg) | ||
|
||
Let’s assume there are two developers: Developer A and Developer B. Both of them pull the same code file from the remote repository and try to make various amendments in that file. After making the changes, Developer A pushes the file back to the remote repository from his local repository. Now, when Developer B tries to push that file after making the changes from his end, he is unable to do so, as the file has already been changed in the remote repository. | ||
|
||
To prevent such conflicts, developers work in separate isolated branches. The Git merge command combines separate branches and resolves any conflicting edits. | ||
|
||
#### ✍️ Step by Step Blog to Resolve Merge Conflicts : **([👉Click Here](https://www.freecodecamp.org/news/how-to-fix-merge-conflicts-in-git/))** | ||
|
||
|
||
![](Images/m3.png) | ||
#### 🍂 Some Git Commands to Resolve Merge Conflicts | ||
|
||
```code | ||
👉 Format : git log --merge | ||
✍️ This command helps to produce the list of commits that are causing the conflict. | ||
``` | ||
|
||
```code | ||
👉 Format : git diff | ||
✍️ This command helps to identify the differences between the states repositories or file | ||
``` | ||
|
||
#### 🎶 Add Audio on README.md File: **([👉Click Here](https://www.geeksforgeeks.org/how-to-add-audio-files-on-readme-md-file-in-a-github-repository-from-the-local-system/))** | ||
```code | ||
👉 Format : git checkout | ||
✍️ This command is used to undo the changes made to the file, or for changing branches.. | ||
``` | ||
|
||
```code | ||
👉 Format : git reset --mixed | ||
✍️ This command is used to undo changes to the working directory and staging area | ||
``` | ||
|
||
#### 📸 Add Images on README.md File: **([👉Click Here](https://www.geeksforgeeks.org/how-to-add-images-on-readme-md-file-in-a-github-repository-from-the-local-system/))** | ||
```code | ||
👉 Format : git reset --mixed | ||
✍️ This command helps in exiting the merge process and returning back to the state before the merging began. | ||
``` | ||
|
||
```code | ||
👉 Format : git reset | ||
✍️ This command is used at the time of merge conflict to reset the conflicted files to their original state. | ||
``` | ||
|
||
#### 💃 Add GIFs on README.md File: **([👉Click Here](https://www.geeksforgeeks.org/how-to-add-gifs-on-readme-md-file-in-a-github-repository/))** | ||
```code | ||
👉 Format : git status | ||
✍️ This command displays the current state of the working directory and the repository. | ||
✍️ It shows which files are modified, untracked, or staged for commit. | ||
``` | ||
|
||
|
||
```code | ||
👉 Format : cd documentss | ||
✍️ 'cd' is used to change the current working directory in the command line.. | ||
``` | ||
```code | ||
👉 Format : cat file.txt | ||
✍️ 'cat' stands for "concatenate" and is used to display the contents of a file.. | ||
``` | ||
```code | ||
👉 Format : vi example.txt | ||
✍️ 'vi' is a text editor available on Unix-like operating systems. | ||
✍️ It allows you to create and edit files from the command line. | ||
``` | ||
```code | ||
👉 Format : git rebase origin master | ||
✍️ This command is used to reapply commits on top of another branch | ||
(usually master) to incorporate changes and keep a linear commit history.. | ||
``` | ||
```code | ||
👉 Format : git rebase --abort | ||
✍️ This command aborts an ongoing rebase operation, | ||
reverting the repository back to its original state before the rebase. | ||
``` | ||
```code | ||
👉 Format : git merge branch-name | ||
✍️ This command merges changes from one branch into another. | ||
``` | ||
```code | ||
👉 Format : git mergetool | ||
✍️ This command launches a merge resolution tool | ||
to help resolve conflicts during a merge or rebase. | ||
``` | ||
```code | ||
👉 Format : git rebase --continue | ||
✍️ This command continues a rebase operation after | ||
resolving conflicts in the conflicted files. | ||
``` | ||
|
||
|
||
<hr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters