Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialCarlos Vieira
Courses Plus Student 1,345 PointsHow can we resolve a merge conflict if file is not a text or code?
Let's say I make an edit on an image in a branch and I edit the same image on master. What will happen? Or what happens, for instance, with photoshop files?
1 Answer
Steven Parker
231,275 PointsWith a binary file, you have to decide if you want to keep your version of the file or the one you are merging from.
To commit your file:
git checkout --ours -- somepath/foobar.bin
git add somepath/foobar.bin
git commit
And to commit the file from the other branch, do the same thing but instead of the "ours" option, use "theirs".
Carlos Vieira
Courses Plus Student 1,345 PointsCarlos Vieira
Courses Plus Student 1,345 PointsThank you, but what happens when there I do
git merge
? I will just be prompt to select one of the files?Steven Parker
231,275 PointsSteven Parker
231,275 PointsI think it just informs you that there is a conflict.
Carlos Vieira
Courses Plus Student 1,345 PointsCarlos Vieira
Courses Plus Student 1,345 PointsThank you:) Yes, it makes sense. Like, '''merge conflict in image.jpg'''.