Git Apprentice by By Chris Belanger and Bhagat Singh

Git Apprentice by By Chris Belanger and Bhagat Singh

Author:By Chris Belanger and Bhagat Singh
Language: eng
Format: epub
Publisher: Ray Wenderlich


Graphical views of your repository

So what else can git log do? Well, Git has some simple methods to show you the branching history of your repository. Execute the following command to see a rather verbose view of the “tree” structure of your repository history:

git log --graph

Page through a few results by pressing the Spacebar (or scroll using the arrow keys), and you’ll see where I merged a branch in an early version of the repository:

. . . commit fbc46d3d828fa57ef627742cf23e865689bf01a0 | Author: Chris Belanger <[email protected]> | Date: Thu Jan 10 10:18:14 2019 -0400 | | Adding files for article ideas | * commit 5fcdc0e77adc11e0b2beca341666e89611a48a4a |\ Merge: 39c26dd cfbbca3 | | Author: Chris Belanger <[email protected]> | | Date: Thu Jan 10 10:14:56 2019 -0400 | | | | Merge branch 'video_team' | | | * commit cfbbca371f4ecc80796a6c3fc0c084ebe181edf0 | | Author: Chris Belanger <[email protected]> | | Date: Thu Jan 10 10:06:25 2019 -0400 | | | | Removing brain download as per ethics committee . . .

And if you page down a little more, you’ll see the point where I created the branch off of master:

* | commit 39c26dd9749eb627056b938313df250b669c1e4c | | Author: Chris Belanger <[email protected]> | | Date: Thu Jan 10 10:13:32 2019 -0400 | | | | I should write a book on git someday | | * | commit 43b4998d7bf0a6d7f779dd2c0fa4fe17aa3d2453 |/ Author: Chris Belanger <[email protected]> | Date: Thu Jan 10 10:12:36 2019 -0400 | | Adding book ideas file | * commit becd762cea13859ac32841b6024dd4178a706abe | Author: Chris Belanger <[email protected]> | Date: Thu Jan 10 09:49:23 2019 -0400 | | Creating the directory structure | * commit 73938223caa4ad5c3920a4db72920d5eda6ff6e1 Author: crispy8888 <[email protected]> Date: Wed Jan 9 20:59:40 2019 -0400 Initial commit

But that’s still too much information. How could you collapse this tree-like view to only see the commit messages, but still see the branching history? That’s right — by stacking the options to git log.

Exit by pressing the Q key and execute the following to see a more condensed view:

git log --oneline --graph

You’ll see a nice, compact view of the history and branching structure:

~/GitApprentice/ideas $ git log --oneline --graph * 477e542 (HEAD -> main) Adding .gitignore files and HTML * ffcedc2 Adds all the good ideas about management * 8409427 Removes terrible live streaming ideas * 67fd0aa Moves platform ideas to website directory * 0ddfac2 Updates book ideas for Symbian and MOS 6510 * 6c88142 Adding some tutorial ideas * ce6971f Adding empty tutorials directory * 57f31b3 Added new book entry and marked Git book complete * f65a790 (origin/main, origin/HEAD) Updated README.md to reflect current working book title. * c470849 (origin/master) Going to try this livestreaming thing * 629cc4d Some scratch ideas for the iOS team * fbc46d3 Adding files for article ideas * 5fcdc0e Merge branch 'video_team' |\ | * cfbbca3 Removing brain download as per ethics committee | * c596774 Adding some video platform ideas | * 06f468e Adding content ideas for videos * | 39c26dd I should write a book on git someday * | 43b4998 Adding book ideas file |/



Download



Copyright Disclaimer:
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.