Pro Git by Scott Chacon & Ben Straub
Author:Scott Chacon & Ben Straub
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA
Merge Log
Another useful tool when resolving merge conflicts is git log. This can help you get context on what may have contributed to the conflicts. Reviewing a little bit of history to remember why two lines of development were touching the same area of code can be really helpful sometimes.
To get a full list of all the unique commits that were included in either branch involved in this merge, we can use the “triple dot” syntax.
$ git log --oneline --left-right HEAD...MERGE_HEAD
< f1270f7 update README
< 9af9d3b add a README
< 694971d update phrase to hola world
> e3eb223 add more tests
> 7cff591 add testing script
> c3ffff1 changed text to hello mundo
That’s a nice list of the six total commits involved, as well as which line of development each commit was on.
We can further simplify this though to give us much more specific context. If we add the --merge option to git log, it will only show the commits in either side of the merge that touch a file that’s currently conflicted.
$ git log --oneline --left-right --merge
< 694971d update phrase to hola world
> c3ffff1 changed text to hello mundo
If you run that with the -p option instead, you get just the diffs to the file that ended up in conflict. This can be really helpful in quickly giving you the context you need to help understand why something conflicts and how to more intelligently resolve it.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7773)
Filmora Efficient Editing by Alexander Zacharias(5875)
The Infinite Retina by Robert Scoble Irena Cronin(5347)
Learn Wireshark - Fundamentals of Wireshark. by Lisa Bock(4025)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3941)
Edit Like a Pro with iMovie by Regit(3474)
Linux Administration Best Practices by Scott Alan Miller(2864)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic & Jasmin Redzepagic(2840)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2529)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(2445)
Docker on Windows by Stoneman Elton(2323)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2317)
Creative Projects for Rust Programmers by Carlo Milanesi(2292)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(2115)
Hands-On Linux for Architects by Denis Salamanca(2056)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(2012)
Computers For Seniors For Dummies by Nancy C. Muir(2009)
The Old New Thing by Raymond Chen(1943)
Linux Kernel Debugging by Kaiwan N Billimoria(1770)
