You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your local repo is now up-to-date with the "Parent" repo. Sync these changes to make your remote repo up-to-date with "Parent" as well.
142
+
143
+
## 7. (Potentially) Resolve merge conflicts
144
+
Merge conflicts arise when Git doesn't know how to reconcile conflicting changes occuring on the same file. In these situations, Git leaves it to the user to figure out how to best resolve the conflicting changes.
145
+
For this example, to create a merge conflict, navigate to your local repo and run:
146
+
```
147
+
git pull upstream patrick_branch
148
+
```
149
+
Don't worry too much about the specifics of this command for now. You should see some text:
150
+
```
151
+
Auto-merging some_file.txt
152
+
CONFLICT (content): Merge conflict in some_file.txt
153
+
Automatic merge failed; fix conflicts and then commit the result.
154
+
```
155
+
Opening up some_file.txt in any text editor, you should see something like:
156
+
```
157
+
This file contains some text
158
+
Some change katherine has made
159
+
Another change katherine has made
160
+
Some change patrick has made
161
+
```
162
+
The text within the `<<<<<<<` and the `>>>>>>>` are the conflicting areas.
163
+
Anything between `<<<<<<< HEAD` and `=======` represent what you had in the file, before trying to merge in any new changes.
164
+
Anything between `=======` and `>>>>>>>` represent what the incoming changes are.
165
+
You can choose to accept what you had, the incoming changes, both, or a mixture of the two.
166
+
For our example, let's choose to accept both, so remove the any lines with `<<<<<<< HEAD`, `=======` and `>>>>>>>`
167
+
Your file should now look like:
168
+
```
169
+
This file contains some text
170
+
Some change katherine has made
171
+
Another change katherine has made
172
+
Some change patrick has made
173
+
```
174
+
Now, to finish up the merge, we need to add/commit our changes.
0 commit comments