100% found this document useful (2 votes)
17 views

Git Apprentice Second Edition Raywenderlich Tutorial Team - Download the ebook today and own the complete content

The document provides links to download the 'Git Apprentice Second Edition' and other recommended ebooks or textbooks from ebookultra.com. It includes details about the authors, copyright information, and a comprehensive table of contents for the Git Apprentice book. The document emphasizes the availability of various educational resources related to Git and programming topics.

Uploaded by

mueslykorpel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
17 views

Git Apprentice Second Edition Raywenderlich Tutorial Team - Download the ebook today and own the complete content

The document provides links to download the 'Git Apprentice Second Edition' and other recommended ebooks or textbooks from ebookultra.com. It includes details about the authors, copyright information, and a comprehensive table of contents for the Git Apprentice book. The document emphasizes the availability of various educational resources related to Git and programming topics.

Uploaded by

mueslykorpel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Visit https://ebookultra.

com to download the full version and


explore more ebooks or textbooks

Git Apprentice Second Edition Raywenderlich


Tutorial Team

_____ Click the link below to download _____


https://ebookultra.com/download/git-apprentice-second-
edition-raywenderlich-tutorial-team/

Explore and download more ebooks or textbooks at ebookultra.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Kotlin Coroutines by Tutorial Mastering Coroutines in


Kotlin and Android 2nd Edition Raywenderlich Tutorial Team

https://ebookultra.com/download/kotlin-coroutines-by-tutorial-
mastering-coroutines-in-kotlin-and-android-2nd-edition-raywenderlich-
tutorial-team/

Infrared Optics and Zoom Lenses Second Edition SPIE


Tutorial Text Vol TT83 Tutorial Texts in Optical
Engineering Allen Mann
https://ebookultra.com/download/infrared-optics-and-zoom-lenses-
second-edition-spie-tutorial-text-vol-tt83-tutorial-texts-in-optical-
engineering-allen-mann/

Infrared Optics and Zoom Lenses Second Edition SPIE


Tutorial Text Vol TT83 Tutorial Texts in Optical
Engineering Allen Mann
https://ebookultra.com/download/infrared-optics-and-zoom-lenses-
second-edition-spie-tutorial-text-vol-tt83-tutorial-texts-in-optical-
engineering-allen-mann-2/

Pro Git 2nd Edition Scott Chacon

https://ebookultra.com/download/pro-git-2nd-edition-scott-chacon/
Professional Git 1st Edition Brent Laster

https://ebookultra.com/download/professional-git-1st-edition-brent-
laster/

Git in Practice 1st Edition Mike Mcquaid

https://ebookultra.com/download/git-in-practice-1st-edition-mike-
mcquaid/

Git for Humans 1st Edition David Demaree

https://ebookultra.com/download/git-for-humans-1st-edition-david-
demaree/

The Midwife s Apprentice Lisa French

https://ebookultra.com/download/the-midwife-s-apprentice-lisa-french/

Jurisprudence tutorial 1st Edition Galieva.

https://ebookultra.com/download/jurisprudence-tutorial-1st-edition-
galieva/
Git Apprentice Second Edition Raywenderlich Tutorial
Team Digital Instant Download
Author(s): raywenderlich Tutorial Team, Chris Belanger, Bhagat Singh
ISBN(s): 9781950325511, 1950325512
Edition: 2
File Details: PDF, 5.96 MB
Year: 2021
Language: english
Git Apprentice Git Apprentice

Git Apprentice
Chris Belanger & Bhagat Singh

Copyright ©2021 Razeware LLC.

Notice of Rights
All rights reserved. No part of this book or corresponding materials (such as text,
images, or source code) may be reproduced or distributed by any means without
prior written permission of the copyright owner.

Notice of Liability
This book and all corresponding materials (such as source code) are provided on an
“as is” basis, without warranty of any kind, express of implied, including but not
limited to the warranties of merchantability, fitness for a particular purpose, and
noninfringement. In no event shall the authors or copyright holders be liable for any
claim, damages or other liability, whether in action of contract, tort or otherwise,
arising from, out of or in connection with the software or the use of other dealing in
the software.

Trademarks
All trademarks and registered trademarks appearing in this book are the property of
their own respective owners.

raywenderlich.com 2
Git Apprentice

Table of Contents: Overview


Book License ................................................................................................ 8
Before You Begin ................................................................... 9
What You Need ........................................................................................ 10
Book Source Code & Forums ............................................................. 11
Acknowledgments .................................................................................. 14
Introduction .............................................................................................. 15
Section I: Beginning Git .................................................... 18
Chapter 1: A Crash Course in Git ......................................... 19
Chapter 2: Cloning a Repo ...................................................... 32
Chapter 3: Committing Your Changes ............................... 42
Chapter 4: The Staging Area .................................................. 62
Chapter 5: Ignoring Files in Git ............................................. 75
Chapter 6: Git Log & History .................................................. 83
Chapter 7: Branching ................................................................ 98
Chapter 8: Merging ................................................................. 109
Chapter 9: Syncing With a Remote ................................... 123
Chapter 10: Creating a Repository ................................... 138
Conclusion .............................................................................................. 152
Section II: Appendices .................................................... 153
Appendix A: Installing & Configuring Git ....................... 154

raywenderlich.com 3
Git Apprentice

Table of Contents: Extended


Book License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
What You Need . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Book Source Code & Forums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
About the Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Content Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Enter the video courses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
How to read this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Section I: Beginning Git . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18


Chapter 1: A Crash Course in Git . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
What are remote repositories? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Forking the remote repository. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Cloning the repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Creating a branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Making and staging changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Committing changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Pushing your changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Creating a pull request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Chapter 2: Cloning a Repo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
What is cloning?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Using GitHub . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Forking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

raywenderlich.com 4
Git Apprentice

Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Chapter 3: Committing Your Changes . . . . . . . . . . . . . . . . . . . . . . . 42
What is a commit? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Working trees and staging areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Committing your changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Adding directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Looking at git log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Chapter 4: The Staging Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Why staging exists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Undoing staged changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Moving files in Git . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Deleting files in Git. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Chapter 5: Ignoring Files in Git . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Introducing .gitignore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Nesting .gitignore files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Looking at the global .gitignore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Finding sample .gitignore files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Chapter 6: Git Log & History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Viewing Git history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

raywenderlich.com 5
Git Apprentice

Vanilla git log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84


Limiting results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Graphical views of your repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Viewing non-ancestral history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Using Git shortlog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Searching Git history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Where to go from here?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Chapter 7: Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
What is a commit? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
What is a branch? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Creating a branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
How Git tracks branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Checking your current branch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Switching to another branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Viewing local and remote branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Explaining origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Viewing branches graphically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
A shortcut for branch creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Chapter 8: Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
A look at your branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Three-way merges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Merging a branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Fast-forward merge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Forcing merge commits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

raywenderlich.com 6
Git Apprentice

Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122


Chapter 9: Syncing With a Remote . . . . . . . . . . . . . . . . . . . . . . . . . 123
Pushing your changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Pulling changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Dealing with multiple remotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Chapter 10: Creating a Repository . . . . . . . . . . . . . . . . . . . . . . . . . 138
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Creating a LICENSE file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Creating a README file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Creating and syncing a remote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Key points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Where to go from here? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Section II: Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Appendix A: Installing & Configuring Git . . . . . . . . . . . . . . . . . . . 154
Installing on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Installing on macOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Configuring credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Setting your username and email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Persisting your password. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

raywenderlich.com 7
L Book License

By purchasing Git Apprentice, you have the following license:

• You are allowed to use and/or modify the source code in Git Apprentice in as many
apps as you want, with no attribution required.

• You are allowed to use and/or modify all art, images and designs that are included
in Git Apprentice in as many apps as you want, but must include this attribution
line somewhere inside your app: “Artwork/images/designs: from Git Apprentice,
available at www.raywenderlich.com”.

• The source code included in Git Apprentice is for your personal use only. You are
NOT allowed to distribute or sell the source code in Git Apprentice without prior
authorization.

• This book is for your personal use only. You are NOT allowed to sell this book
without prior authorization, or distribute it to friends, coworkers or students; they
would need to purchase their own copies.

All materials provided with this book are provided on an “as is” basis, without
warranty of any kind, express or implied, including but not limited to the warranties
of merchantability, fitness for a particular purpose and noninfringement. In no event
shall the authors or copyright holders be liable for any claim, damages or other
liability, whether in an action of contract, tort or otherwise, arising from, out of or in
connection with the software or the use or other dealings in the software.

All trademarks and registered trademarks appearing in this guide are the properties
of their respective owners.

raywenderlich.com 8
Before You Begin

This section tells you a few things you need to know before you get started, such as
what you’ll need for hardware and software, where to find the project files for this
book, and more.

raywenderlich.com 9
i What You Need

To follow along with this book, you’ll need the following:

• Git 2.32 or later. Git is the software package you’ll use for all the work in this
book. There are installers for macOS, Windows and Linux available for free from
the official Git page here: https://git-scm.com/downloads. We’ve tested this book
on Git 2.32.0, but you can follow along with older versions of Git as well.

raywenderlich.com 10
ii Book Source Code &
Forums

Book source code


The materials for this book are all available in the GitHub repository here:

• https://github.com/raywenderlich/gita-materials/tree/editions/2.0

You can download the entire set of materials for the book from that page.

Forum
We’ve also set up an official forum for the book at https://
forums.raywenderlich.com/c/books/git-apprentice. This is a great place to ask
questions about the book or to submit any errors you may find.

raywenderlich.com 11
“For Russ and Skip.”

— Chris Belanger

“For my mother, who always believed in me..”

— Bhagat Singh

raywenderlich.com 12
Git Apprentice About the Team

About the Authors


Chris Belanger is an author of this book. He is the CMO of
raywenderlich.com. If there are words to wrangle or a paragraph to
ponder, he‘s on the case. In the programming world, Chris has over
25 years of experience with multiple database platforms, real-time
industrial control systems, and enterprise healthcare information
systems. When he kicks back, you can usually find Chris with guitar
in hand, looking for the nearest beach, or exploring the lakes and
rivers in his part of the world in a canoe.

Bhagat Singh is an author of this book. He hails from New Delhi,


India. Bhagat started iOS Development as a hobby which
eventually became his profession. His design practice combines
design thinking and experience strategy with a relentless focus on
the user. He has also been contributing in the raywenderlich.com
tutorial team from past three years. When the laptop lid shuts
down, you can find him chilling with his friends and finding new
places to eat. He dedicates all his success to his mother. You can
find Bhagat on Twitter: @soulful_swift (https://twitter.com/
soulful_swift)

About the Editors


Aaron Douglas is the final pass editor for this book. He was that
kid taking apart the mechanical and electrical appliances at five
years of age to see how they worked. He never grew out of that core
interest - to know how things work. He took an early interest in
computer programming, figuring out how to get past security to be
able to play games on his dad’s computer. He’s still that feisty nerd,
but at least now he gets paid to do it. Aaron works for Automattic
(WordPress.com, WooCommerce, Tumblr, SimpleNote) as a Mobile
Lead primarily on the WooCommerce mobile apps. Find Aaron on
Twitter as @astralbodies or at his blog at https://aaron.blog.

raywenderlich.com 13
v Acknowledgments

Content Development
We would like to thank Chris Belanger for his work on the previous edition of the
book.We also should mention Sam Davies whose evergreen video course is the basis
of this book.

raywenderlich.com 14
vi Introduction

There are usually two reasons a person picks up a book about Git: one, they are
unusually curious about how the software works at a deeper level; or two, they’re
frustrated and need something to solve their problems now.

Whatever situation brought you here, welcome! I’m happy to have you onboard. I
came to write this book for both of the above reasons. I am a tinkerer and hacker by
nature, and I love going deep into the internals of software to see what makes them
tick. But I, like you, found Git at first to be an inscrutable piece of software. My brain,
which had been trained in software development through the late 1990s, found
version control packages like SVN soothing, with their familiar client-server
architecture, Windows shell integration, and rather straightforward, albeit heavy,
processes.

When I came to use Git and GitHub about seven years ago, I found it inscrutable at
best; it seemed no matter which way I turned, Git was telling me I had a merge
conflict, or it was merging changes from the master branch into my current branch,
or quite often complaining about unstaged changes. And why was it called a “pull
request”, when clearly I was trying to push my changes into the master branch?

Little by little, I learned more about how Git worked; how to solve some of the
common issues I encountered, and I eventually got to a point where I felt
comfortable using it on a daily basis.

raywenderlich.com 15
Git Apprentice Introduction

Enter the video courses


In early 2017, my colleague Sam Davies created a conference talk, titled “Mastering
Git”, and from that, two video courses at raywenderlich.com: “Beginning Git” and
“Mastering Git”. Those two courses form the basis of this book, but it always nagged
me a little that, while Sam’s video version of the material was quite pragmatic and
tied nicely into using both the command line and graphical tools to solve common
Git workflow problems, I always felt like there was a bit of detail missing; the kind of
information that would lead a curious mind to say “I see the how, but I really want to
know more about the why.”

This book gives a little more background on the why: or, in other words, “Why the
%^&$ did you do that to my repository, Git?!” Underneath the hood, you’ll find that
Git has a rather simple and elegant architecture, which is why it scales so well to the
kinds of globally distributed projects that use Git as their version control software,
via GitHub, GitLab, Bitbucket, or other cloud repository management solutions.

And while GUI-based Git frontends like Tower or GitHub Desktop are great at
minimizing effort, they abstract you away from the actual guts of Git. That’s why this
book takes a command-line-first approach, so that you’ll gain a better understanding
of the various actions that Git takes to manage your repositories — and more
importantly, you’ll gain a better understanding of how to fix things when Git does
things that don’t seem to make much sense.

How to read this book


This book covers Beginning Git. If you are still struggling to figure out the
difference between a push and a commit, or you’re coming to Git from a different
version control system, start here. This section takes you through concepts such as
cloning, staging, committing, syncing, merging, viewing logs, and more. The very
first chapter is a crash course on using Git, where you’ll go through the basic Git
workflow to get a handle on the how before you move into the what and the why.

This book works with a small repository that houses a simple ToDo system based on
text files that hold ideas (both good and bad) ideas for content for the website. It’s an
ideal way to learn about Git without getting bogged down in a particular language or
framework.

The next book in our mastering Git series, Advanced Git, which we encourage you to
explore once you’ve completed this book.

raywenderlich.com 16
Git Apprentice Introduction

Workflows
This section takes a look at some common Git workflows, such as the feature branch
workflow, Gitflow, a basic forking workflow, and even a centralized workflow.
Because of the flexibility of Git, lots of teams have devised interesting workflows for
their teams that work for them — but this doesn’t mean that there’s a single right
way to manage your development.

Learning by doing
Above all, the best advice I can give is to work with Git: find ways to use it in your
daily workflows, find ways to contribute to open-source projects that use Git to
manage their repositories, and don’t be afraid to try some of the more esoteric Git
commands to accomplish something. There’s little chance you’ll screw anything up
beyond repair, and most developers learn best when they inadvertently back
themselves into a technical rabbit-hole — then figure out how to dig themselves out.

A note on master vs. main


At the time that this book went to press, GitHub (and potentially other hosts) were
proposing changing the name of the default repository branch to main, instead of
master, in an attempt to use more culturally-aware language. So if you’re working
through this book and realize that some repos use main as the central reference
branch, don’t worry — simply use main in place of master where you need to in these
commands. If the point comes when there seems to be a consensus on main vs
master in the Git community, we’ll modify the book to match.

I wish you all the best in your Git adventures. Time to Git going! — Chris Belanger

raywenderlich.com 17
Section I: Beginning Git

This section is intended to get newcomers familiar with Git. It will introduce the
basic concepts that are central to Git, how Git differs from other version control
systems, and the basic operations of Git like committing, merging, and pulling.

You may discover things in this section you didn’t quite understand about Git, even
if you’ve used Git for a long time.

raywenderlich.com 18
1 Chapter 1: A Crash Course
in Git
By Chris Belanger and Bhagat Singh

It can be a bit challenging to get started with command-line Git if you haven’t done
much work on the command line before. Since you’ll be interacting with Git through
the command line throughout this book, this chapter will take you through a quick
crash course on how to do it.

There’s a common workflow that serves as the foundation of most interactions you’ll
have with Git:

• Create a fork of an existing repository.

• Copy a remote repository to your own computer.

• Create a separate working area in the repository where you can make changes
without affecting anyone else.

• Flag those changes to be saved to the local copy of the repository.

• Save those changes in your local copy of the repository.

• Synchronize those changes with the remote repository.

• Optionally, notify the repository owner that your changes are ready to be
reviewed.

This chapter will take you through all the above actions to help you get familiar with
the basics of working with Git through the command line.

Although this chapter won’t explain everything in detail, it will give you enough
familiarity with a Git repository and the basic Git workflow to better understand the
chapters to come.

raywenderlich.com 19
Git Apprentice Chapter 1: A Crash Course in Git

What are remote repositories?


A remote repository is simply a collection of all the files of a project, hosted
somewhere other than your local machine. They could be hosted internally on your
network, but more often, you’ll work with remote repositories hosted on cloud
services like GitHub and GitLab.

Having a centralized remote repository makes sharing and contributing to a project


easy. Instead of sending files to interested people, you simply point them to the
hosted remote repository to get them up and running as quickly as possible.

The first step is to create your own personal online copy, or fork, of the remote
repository. That gives you a place to work online and lets you follow the instructions
in this chapter without affecting any of the millions of other people reading this
book and following along themselves.

Forking the remote repository


Navigate to the following URL in a browser:

• https://github.com/raywenderlich/programmer-jokes

You’ll see a screen like the following:

raywenderlich.com 20
Other documents randomly have
different content
unpleasant to her, after every excursion,—and it was his constant
desire to promote the happiness of one so tenderly beloved. Perhaps
he took not the most certain way to increase her happiness;—but
that was the fault of his head—not his heart!

Mrs. North never teazed, or even asked her husband for any
gratification. She was, at once too amiable, and too polite to do
either; yet she had a way of her own—and a most graceful and
fascinating way it was—of leading him on to propose the very thing
she had resolved on,—and then yielding to his plan, with an air of
relinquishing some more favored scheme of her own, for the
pleasure of gratifying him. Indeed, every thing she did, was done in
the most amiable and graceful manner—even to the spending of
money, which she did with the air of a princess. And her husband
sometimes feared she was a little too profuse; but she dressed with
such taste; was so generous, and so much the belle wherever she
appeared, that he could not find it in his heart to supply her purse
less liberally.

For nearly three months Mr. and Mrs. North were scarcely at L——
for more than a week at a time; and the cold winds and bad roads
of November, alone led them to settle quietly at home. On every
return to L——, Mr. and Mrs. Lawrence had been duly visited; and
now, when the autumnal campaign was fairly over, their society was
more needed, more valued than ever. Scarcely twenty-four hours
passed, without bringing Mrs. Lawrence the favor of a longer or
shorter visit.

"And so, my dear Mrs. Lawrence, you have not been five miles from
L——, since my journey to Boston last August?"

"I have not."

"Nor wanted to be, I suppose," said Mrs. North.

"All circumstances considered, I have not," answered Mrs. Lawrence.


"It would afford me great pleasure to see various parts of the world,
—in the Southern as well as Northern States of the Union,—in
Europe as well as America; but as I am situated, by the providence
of an all-wise Father, I must content myself with the knowledge of
different places, that I can derive from books. And this, if not so
satisfactory, is, at least, a cheaper mode of obtaining information,
than travelling."

Two things in this answer struck Mrs. North. "A cheaper mode!" Yes
—as Mr. Lawrence inherited no fortune, it was necessary for his wife
to think of economy. How fortunate for herself that Mr. North's father
was a rich man! "Knowledge—travelling to obtain knowledge!" The
idea had never before occurred to her mind. She had always
travelled solely for pleasure.

Mrs. Lawrence really felt attached to Mrs. North. Her amiable temper
and pleasing manners had won her affections, and she wished to do
her good. She soon learned that her friend had many false notions:
that, in her estimation, wealth was the most valuable distinction;
that show was elegance; and that dress and idleness were gentility.
She saw, too, that she was nearly, or quite destitute of internal
sources of happiness; that all the nobler powers of her mind lay
dormant; that she seemed to have no idea of intellectual pleasures.
Mrs. Lawrence had no conception of the difficulty of the task she
wished to accomplish; she knew not how deep-rooted were the evils
she wished to subdue; knew not that they were completely
intertwined with her whole mental constitution.

Mrs. Lawrence often heard Mrs. North talk of books; and she
directed her to a course of reading, which she thought would at
once prove highly interesting and beneficial. But Mrs. North had
never really read a book for pleasure, or for intellectual
improvement, in her life. She had never been taught by her parents,
and had never conceived the idea herself, that the object in the
acquisition of knowledge, was to fit her for the discharge of duties to
herself and others.
The knowledge she really possessed, was acquired for the express
purpose of display—to give her distinction in the circle in which she
moved. Of course she had gone about the acquisition of it, not as a
pleasure, but as a task that must be accomplished. Mrs. Lawrence
had likewise heard her speak of the benevolent societies with which
she had been connected in her native place, and she strove to
awaken her sympathies for the poor in L——, and excite interest in
benevolent enterprises of a higher order. But although Mrs. North
would give freely, and, particularly if a subscription paper was
handed about, would subscribe liberally, there was evidently no
heart in her charities. She could find no pleasure in searching out
the destitute and afflicted in her own person. If she heard of one
who was sick, she would perhaps send them a sum of money
preposterously large, that Mrs. North might be spoken of as a most
munificent lady; but she could not have made a basin of broth, to
have saved a life. She knew nothing of the system of benefitting the
poor at a very trifling expense of time and labor, by making
comfortable garments out of old ones that were lying useless, an
encumbrance to closets and drawers. It is nearly useless to give
such garments to the poor in an unprepared state; seldom have they
sufficient ingenuity, or patience, or industry, to turn them to
profitable account. Mrs. Lawrence was fully aware of this; and she
was remarkable for the ingenuity and dexterity with which she would
make a comfortable suit of clothes for a poor child, out of garments
that appeared not worth a farthing. She was a blessing to the poor
around her; and her husband had in no way to pay the penalty of
her charities, as is sometimes, unhappily, the case. Mrs. Lawrence
endeavored to interest Mrs. North in this way of doing good; but the
attempt was fruitless. How could a lady degrade herself by attending
to such occupations! How could the delicate and elegant Mrs. North
bend her beautiful person over such work; or soil and deface her
fair, round fingers by such menial employments! Equally unavailing
were all Mrs. Lawrence's efforts, to interest her friend in the
cultivation of flowers, or in any employment or pursuit, by which she
could make herself happy in solitude.
The piety of Mrs. North was in perfect accordance with every other
point in her character. At a season of revival of religion in her native
place, many of her youthful companions becoming deeply interested
in the subject, her sympathies were awakened; and she mistook
these feelings, as is, alas, too often the case, for renovation of heart.
—Beside, "religion walked in her golden slippers;" it was fashionable
to be benevolent, and charitable, and attend meetings; and Anna
Weston went with others; and with others she publicly and solemnly
"avouched the Lord to be her God," and consecrated herself to his
service! But one view of her own heart she had never had. She still
loved the world, and the things of the world, "the lusts of the eye,
and the pride of life," and scarcely felt, or knew that it was wrong.
She lived for herself; and she loved herself—supremely; and she was
not conscious, much less was Mr. North, that her strongly expressed
attachment to her husband, principally arose from the ability he
possessed to gratify her in all the selfish desires of her heart.

Mrs. Lawrence could not but perceive that the feelings of Mrs. North
were very superficial on the subject of religion; and she knew that
the views that resulted in such practice, must be erroneous. As a
christian, deeply interested in the honor of Him "who had redeemed
her to God by his own blood,"—and anxious that every one of his
professed disciples should "walk worthy of their high vocation," she
often conversed with Mrs. North on the subject; and by the gentlest
and most touching appeals, strove to touch her heart, and awaken
and enlighten her conscience. But here, too, she was unsuccessful.
Mrs. North would so readily assent to all she said, with
"Certainly"—"O, yes, every christian should feel and act thus,"—that
Mrs. Lawrence felt that the case was, at present, hopeless. There
was no feeling; there was not even thought;—it was a mere assent
of the voice.

But an event was now in prospect that seemed to have a great


effect on Mrs. North; and which frequently has a vast effect in
deciding character. Life is always uncertain,—and, in a moment of
reflection, every one is willing to acknowledge it; but when a lady
has the prospect of becoming a mother, there is a definite period to
which she looks forward, as the one in which she may be called from
time into eternity. It is an unthinking woman indeed, who is never
serious under such circumstances. Mrs. North was far otherwise. Life
was very dear to her; since her marriage it had been a scene of
unclouded sunshine. But now there was a dark curtain raised before
her, beyond which she trembled to look.

Mrs. Lawrence was one of the most judicious of woman. She


cheered and sustained her friend's spirits, not by leading her to
forget, or think lightly of her danger, but by teaching her to look at it
rationally,—and be in a state of preparation for her hour of trial.—
And never had she been so much encouraged, for never had Mrs.
North appeared so much as she wished to see her. Her feelings were
very tender, and a review of the many blessings she had enjoyed,
seemed to fill her with gratitude for the past; and inspire in her
some degree of confidence for the future. She professed to hope,
that whether she were to live, or to die, all would be well.

At length Mrs. North became the joyful mother of a fine son; and her
feelings were in a glow of gratitude. Her heart seemed to expand
with love for every one. Her husband—her friend—never had they
been half so dear!—With her congratulatory kiss, while the tears of
deep tenderness suffused her eyes, Mrs. Lawrence whispered
—"Consecrate yourself, dearest Anna, and this precious little
immortal, to the service of Him who has been your benefactor and
preserver!" With tremulous lips, Mrs. North returned the kiss, and
emphatically whispered—"O dear friend, may I never forget the
impressions of this hour? May I never forget the deep debt of
gratitude I owe to my Father in heaven?"

But, alas, it was not the goodness of Ephraim alone that was "as the
morning cloud, and the early dew!" for the greater part of the
goodness of the whole human family is of the same transitory and
fleeting nature. At the end of six weeks, when Mrs. North left her
chamber, she was precisely the Mrs. North of the year before—
equally thoughtless, equally negligent of duty. With pain Mrs.
Lawrence witnessed all this;—with deep pain she saw indications
that the character of a fashionable woman must be supported at the
expense of being an unnatural mother.

Physicians, when practising in fashionable houses, have a wonderful


faculty of divining what prescriptions will be most agreeable. Mrs.
North had a fine constitution; but like many women brought up with
false notions, she conceived that firm health and refinement were
incompatible with each other. Dr. G——, was very willing to humor
her whim, as it was in no way detrimental to his pecuniary interest;
and he cheerfully acquiesced in her recovering from her confinement
as slowly as she pleased. And when, by her own confession she was
well, he put the cap-stone to the favor in which he previously stood
with her, by saying, what his shrewd observation told him would just
accord with her wishes, namely—that her strength was quite
unequal to the task of nursing; her babe must be sent from home;—
the Dr. knew just the nurse for it—a fine, healthy, good-natured
woman, who would take the best possible care of it, for two dollars
a week; and Mrs. North must take a journey, as change of air and
scene were indispensable to the perfect restoration of her health.

Mrs. Lawrence was truly grieved when she found this arrangement
was made. She had foreseen the probability of it, but she could not
be reconciled to the measure. She justly considered maternal
feelings among the most sacred that belong to earth; and she knew
that nothing more strengthens a mother's love, than the entire
dependance of the child on her for comfort and happiness. She was
fully convinced, that anything that weakens this tie, that nature has
made so strong, must be injurious alike to both parent and offspring.
She was musing on the subject when her husband came in.

"You look sad, my dear Ellen. What is the matter?"

"Mrs. North has put the dear little boy out to nurse."
"She is a fashionable woman! Did you not expect it?"

"I feared it—but I blame Dr. G——, for had he not have proposed it,
I think Anna would have kept the poor little thing with her. He says,
too, that she must journey to confirm her health."

"He knows his patient," said Mr. Lawrence.

"You are severe, my dear husband."

"Do you think so?—but time will show. Meantime I am going to take
you a journey."

"Me! where?"

"To Fryburg. Business calls me there next week—I shall be absent


from home but few days, and the excursion will do you good. Be it
as it may with Mrs. North, change of air and scene are really
necessary for you."

"But the children?" said Mrs. Lawrence.

"I have provided for them," said Mr. Lawrence. "Nurse Bevey has
promised to come and take care of them during our absence?"

"Well, since you have arranged it all," said Mrs. Lawrence, "do
propose to Alpheus that he and Anna accompany us. It may suffice,
—and prevent them from taking one of those long journies that I
begin to dread."

Mr. and Mrs. North were delighted with the proposal. Preparations
were immediately commenced, and at the appointed time, they all
set out on their excursion. We shall not travel with them. Suffice it to
say, that on the evening of the second day after their departure,
they arrived at Mrs. O——'s hotel, in Fryburg. Mr. Lawrence was
rather impatient, as the journey might have been performed in much
less time. But short stages, and long rests were necessary for Mrs.
North—at least she said so—and Mr. and Mrs. Lawrence could not
with propriety drive on before them.

On the morning after their arrival, on looking about them, the ladies
were both in raptures at the scenery around. They had seen nothing
like it before. But we will accompany them to the little Jockey-Cap
mountain, which lies not far from a mile from Mrs. O——'s, which
they ascended in the afternoon, and hear what they say of it there.

"This little mountain is not difficult of ascent," said Mr. Lawrence,


when they had attained its summit—"yet it is rather wearisome,
making ones way through the shrub-oaks—so do you, my dear Ellen,
and Mrs. North, rest awhile on this table of granite, and amuse
yourselves by picking out some of the well-defined garnets that are
imbedded in the rock. When you are rested, you may come with us
toward the verge of the precipice, and view the scenery around."

In a few minutes the ladies got over their fatigue,—and joined their
husbands to enjoy the prospect.

"What is the name of this beautiful sheet of water on our left, Mr.
Lawrence?" asked Mrs. North.

"It is called 'Lovell's pond,'" replied Mr. Lawrence. "It was on the
margin of this peaceful lake, as it should be called, that Capt. Lovell
and his company of militia, met Pangus, the Indian Sachem, at the
head of a part of his tribe, prepared for deadly conflict. In Lovell's
company was a man named John Chamberlain. His rifle, as well as
that of Pangus, had become foul from frequent firing. Standing but a
few paces apart, each cleaned his rifle at the pond—and each
commenced loading at the same moment,—while each watched the
motions of the other with the most intense interest—knowing that
he that was first ready to discharge his rifle, would undoubtedly be
sole survivor. The rifle of Chamberlain was so much worn, that in
being loaded, it primed itself. This circumstance decided the fate of
the Indian Chief—he fell."1
1 After the "fight" at Lovell's pond, the remains of the Pigwacket tribe of Indians, left
the woods and lakes of New Hampshire and Maine, for the broader waters and
deeper forests of Canada. In 1777, Chamberlain had become an old grey-headed
man,—living alone, and laboring in a saw mill to support himself. He was one evening
informed that a young Indian had appeared in the Village, with rifle, wampum belt
and tomahawk, having the noble bearing of old Pangus, the Sachem. Chamberlain
instantly took the alarm; but old as he was, was not intimidated. Well knowing the
Indian character and habits, about the dusk of the evening he put his mill in rapid
motion, raised his coat as a "decoy"—and retired to a short distance to watch what
might follow. In a short time he witnessed the cautious approach of the savage, who
repeatedly advanced and receded, ere he aimed his rifle at the coat. As soon as he
had fired, and raised himself to his full height, (which was above six feet) to ascertain
the effect of his aim, Chamberlain discharged the same rifle that had taken the life of
the Sachem. As the bullet went through his heart, young Pangus sprung some feet in
the air, and fell lifeless in the stream below.

"O, the ever wakeful Providence of our Heavenly Father," whispered


Mrs. Lawrence.

"The beautiful swell of land, directly in front of us, and clothed with
verdure to its summit, is Starkes-hill," said Mr. Lawrence; "that on
our right, just back of the village, is Kearsarge mountain."

"And those beyond, piled one upon another, in seemingly endless


succession—far—far as the eye can reach," cried Mrs. Lawrence,
"are the celebrated white mountains of New-Hampshire. O, how
sublime! how grand! how awful! And Mount Washington raises its
towering head far above the others, as if to overlook, and guard
them all. What majesty is here!—and how elevating to the soul, to
view such specimens of our Creator's workmanship!"

"And what is the name of this beautiful stream, that flows between
us, and the highlands?" asked Mrs. North.

"This river," replied Mr. North, "still retains its Indian appellation—the
Saco!"
"And see," said Mrs. Lawrence, "how it winds around and about, as
if reluctant to leave this broad and beautiful intervale, and striving to
linger in it to the last possible moment."

"I have been told," said Mr. Lawrence, "that before some short
canals were cut, to accelerate the passage of lumber down the
stream, that the Saco ran upwards of thirty miles, in this place, in
making the actual progress of only six towards the ocean."

"And then the beautiful, quiet village," said Mrs. Lawrence, "lying so
securely amid its guardian mountains, with its long, straight street,—
and its church and academy spires, pointing to heaven, speaking of
spiritual and intellectual improvement. O, this scene is perfect in
beauty!—and in grandeur! There the sublime and beautiful are most
happily associated. The overpowering awe that steals upon one,
while viewing those mighty efforts of creative power, which fills the
soul with sensations altogether too big for utterance,—is modified,
when the eye falls, and rests on the peaceful village, which speaks
of human society, comfort and happiness. It seems as if the
inhabitants, brought up with such scenes of beauty and sublimity
constantly before them, must be more free from base and ignoble
passions, than those who live and die amid scenery of a different
character. Every spot on which the eye rests, speaks of the grandeur,
the power, the benevolence—and, if I may so express myself, the
taste of the Divine Architect. I can conceive of nothing more
beautiful—more perfect!—and nothing can have a more elevating
effect on the soul of man! I must believe, with Dr. Dwight, that 'he
who does not find in the various beautiful, sublime, awful and
astonishing objects, presented to us in creation, irresistible and
glorious reasons for admiring, adoring, loving and praising his
Creator, has no claim to evangelical piety.'"

"You are an enthusiast, Mrs. Lawrence," said Mr. North, smiling.

"Perhaps I am. But nothing, after moral grandeur, touches my heart


like the beautiful face of nature. Every flower and tree, and hill and
valley that meets my eye, gives me delight,—and speaks to my soul
of the glorious Being that made them:—how much more such a
picture as is now spread before me!—My dear husband, when our
children are old enough to appreciate its beauty, they must be
brought to this spot. It cannot fail of having a salutary effect, both
on the heart, and mind."

Mr. Lawrence pressed his wife's arm to his side, in token of


approbation. His admiration was divided between the scenery before
him, and a wife,—capable of deriving such exquisite delight, from so
pure a source; and the piety of whose heart, gave a religious cast to
every thing around her. He admired the grand and beautiful in
nature,—but he admired her moral beauty and purity far more.

Mr. North, too, highly enjoyed the natural magnificence presented to


his view; but Mrs. North had felt far greater sensible delight, when,
with a well-filled purse, she had visited a repository of rich and
fashionable goods, or the shop of her milliner. Yet she tried to be
eloquent in praise of the beauties on which they gazed; for
admiration of them was certainly at that moment fashionable on the
summit of the Jockey-Cap; yet there was no heart in her
exclamations of delight; there was no feeling in her expressions of
admiration. Her remarks repressed rather than elicited enthusiasm.
They were like a body without a soul.

On the third morning after their arrival at Fryburg, Mr. and Mrs.
Lawrence prepared to return to L——. The latter was much surprised
when she found that Mr. and Mrs. North were not to return with
them.

"O, we are going through the notch of the White Mountains," said
Mrs. North. "We are told here, that the scenery beyond is infinitely
more magnificent than this, and well worth a much longer journey to
see."
"I doubt not its magnificence," said Mrs. Lawrence, "and should
exceedingly like to view it; yet I much doubt whether any scene, in
beauty of combination, can exceed that we have seen from the
Jockey-Cap. But the little boy, my dear Anna!—Are you not anxious
to see him?"

"O certainly—the little darling!—Yet he is in perfectly good hands,


and a week or two can make no difference. He knows, as yet, no
mother but nurse."

"Nor will he ever," thought Mr. Lawrence.—Mrs. Lawrence sighed.

"Will you take the trouble, my dear friend," said Mr. North, "to look
in occasionally upon nurse, and see that she neglects not her duty?"

"O, do," said Mrs. North; "it will be a great relief to my feelings, to
know that your vigilant eye, is now and then upon the dear boy."

A mingled expression of pity and contempt, sat on the features of


Mr. Lawrence as he turned away; while Mrs. Lawrence promised to
see the little one as often as possible, during the absence of the
parents. They soon parted—the one pair for the notch,—the other
for home.

"I am truly grieved," said Mrs. Lawrence, when they were fairly on
their homeward journey—"I am truly grieved that Alpheus does not
return to L—— with us. I had hoped, that on becoming a mother,
Anna's character would undergo a change. I hoped she would learn
to love home, and domestic scenes. It is to be lamented, that such
qualities as she has, qualities that might make a superior woman,
should all be lost in the woman of fashion—the votary of pleasure.
Fain would I do her good if I could—but I know not how to acquire
influence over her mind."

"It is a hopeless case," answered Mr. Lawrence. "Her character has


no foundation: It is all superstructure. She never acts from principle.
She has no strength of mind. I mean not that she is naturally
deficient in intellectual powers; but she is a parvenu, and all her
mental efforts, instead of giving and increasing mental vigor, are
directed to the one object of making a show, and noise in the world.
And as is almost universally the case with those of her class, she
overdoes. She is thoroughly selfish; and ere any real improvement
can rationally be hoped for, the present edifice must be completely
demolished, and a foundation laid, of new views, new motives, and
new principles. Poor Alpheus! I pity him. The greatest defect in his
character, is that love of show that he inherited from his vulgar
father,—and by which he was governed in the selection of a wife. He
is so amiable and indulgent in his disposition, that he permits her to
lead him as she will. I foresee that she will be his ruin."

Mrs. Lawrence called to see the "deserted baby" as she called him,
the next day after her return to L——, and continued to do so, once
or twice a week, until the return of his parents, which was delayed
for something more than a month. He grew finely,—and before his
mother's arrival, was beginning to "ca" and "coo" and smile in the
nurse's face. And Mrs. Lawrence felt that it would bring a severe
pang to her heart, were the first smile and look of love of an infant
of her own, bestowed on an hireling,—however worthy she might
be. But Mrs. North had no weakness of this kind; on the contrary,
she was delighted with the happiness he manifested in nurse's arms,
as it was incontestible proof of her faithful discharge of duty.

Eight years passed away, and in that time the number of Mrs.
North's children increased to four; but never was a woman less
incommoded by a growing family. Never was there one on whom
care sat more lightly. A few months confinement to L—— now and
then, was to her the most serious part of the business. Five or six
weeks, of as many winters, during this period, had been spent in
Boston or New-York; for a whole winter in L——, unless confined to
her chamber, Mrs. North declared would kill her outright. And the
expense was nothing to be thought of; for Mr. North must go to
purchase goods, and attend to other mercantile concerns; and
taking her with him made but little difference, as she must be
supported somewhere,—and her being with him made not a great
difference in the length of his stay. The summers she passed in L——
were rendered tolerable, by the society of those fashionable friends
she from time to time invited to her house.

Meantime, however, sagacious people began to whisper, that Mr.


North's partner in business, Mr. Mason, (a young man whom he had
taken into partnership, that his affairs might not suffer from neglect,
during his frequent absenses from home,) was growing rich,—not
from dishonest practices, but by attention to business, and
economy; while it was shrewdly conjectured that Mr. North lived to
the full extent of his income, if not a little beyond it. Some persons
of that class who can always foresee what will happen, predicted,
that in five years the junior partner would be sole possessor of the
stock in trade, if not the real estate of Mr. North.

At the close of the same period Mrs. Lawrence was the mother of
five children. She had almost given up the hope of doing Mrs. North
any personal good; but she watched over her friend's neglected
children, during the long periods of her absence from home, with as
much vigilance as was consistent with the faithful discharge of duty
to her own. So far from exhausting,—her diligence increased her
mental vigor; and her character was constantly improving in dignity,
and in every christian grace. Mr. Lawrence had been unremitting in
his attention to business,—and his property had gradually and
constantly increased. His house contained every thing necessary for
comfort, gentility, and intellectual improvement. All was in perfect
keeping. Good judgment, and correct taste were manifest in every
thing in and about the dwelling, while there was nothing like show
or splendor.

"Your husband is now rich, my dear Mrs. Lawrence," said Mrs. North,
after one of her visits to New York, "and I wonder you do not
change, in some measure, your style of furniture and living. You
should have an elegant centre-table in your drawing-room, and
damask curtains, like mine, instead of those modest ones that now
hang at the windows,—beside some beautiful ornaments for the
mantel. And in your library, that you love so well, and which is so
nobly stocked with books, you must have some such delightful
lounges and chairs as I saw in New York,—that you may be quite at
your ease while reading. A few of these things would make your
house look delightfully."

"I am quite satisfied with my furniture, my dear Anna," replied Mrs.


Lawrence,—"and can enjoy a book as much, and understand it as
well, in my old fashioned rocking-chair, as if reclining on the most
delightful lounge in the world."

"Undoubtedly you can; but why not pay some attention to fashion
and elegance, both about your house and dress? I really wonder at
the simplicity of your dress! Your apparel is always very well,
certainly, as to material and form,—but it is too plain. I wish you
would commission me to get some dresses for you;—you would look
like another creature under my hands;—and you can perfectly well
afford to consult your taste in these matters."

"Were the property of my husband twice as large as it is," said Mrs.


Lawrence, "I could not feel justified in incurring unnecessary
expense. We have now five children to educate; and that, of itself,
will require a little fortune. And independently of that, I could never
be at peace with myself, should I expend in unnecessary ornament,
that which would make so many light hearts, and cheerful faces
among the poor,—to say nothing of the more noble, more holy
object, of ameliorating the condition of the heathen world."

Mrs. North colored slightly as she replied—"I know the tenderness of


your conscience; but surely one so remarkably disinterested and
benevolent as yourself, may occasionally indulge a little without
compunction. Do you not carry your scrupulosity too far?"

"There is little danger of our erring on the side of benevolence," said


Mrs. Lawrence. "And if, when we appear for final judgment, it be
said to us, 'inasmuch as ye did it unto one of the least of these, ye
did it unto me,' we shall hardly regret that we made not a more
elegant and splendid appearance, while inhabiting, what will then
emphatically appear to us, 'this dim spot, called earth.'"

The following winter Mrs. North accompanied her husband to


Boston. They had been absent nearly six weeks, when Mrs.
Lawrence was one evening alarmed by the cry of 'fire,' and
hastening to the door, she saw the flames bursting from that part of
Mr. North's house, in which the nursery was situated. Giving hasty
directions to her servants, she flew, with all possible speed, to the
spot. Mr. Lawrence, and many others were already there, and had
succeeded in rescuing all the children from the blazing chamber,
though the third child was burned in a most shocking manner. All the
children were immediately consigned to the care of Mrs. Lawrence,
who had them instantly conveyed to her own house,—while a man
was despatched to call Dr. G—— to the aid of the little sufferer.

Meantime the whole village was collected at Mr. North's house,


which, by the most strenuous exertions, was saved from utter
destruction, though greatly injured. The fire caught in the nursery,
through the carelessness of the nursery-maid, who left the younger
children, and a blazing fire, under the care of the elder,—while she
joined the other servants in the kitchen, to talk over the gossip of
the day.

In a short time, Dr. G—— arrived at the house of Mr. Lawrence, and
after examining the suffering child, gave his opinion that he could
not long survive the injury he had sustained.

As soon as Mr. Lawrence reached home, he despatched a letter and


messenger to apprise Mr. and Mrs. North of the calamity that had
befallen them; and in as short a time as possible they arrived at L
——, the latter nearly frantic with grief.
When she could bring herself to see the little boy, that a few weeks
before, she had left blooming in health and beauty—now a spectacle
of horror—she was overwhelmed. Bitter were the reproaches she
expended on the negligent nursery-maid: but more bitter still her
own self-upbraiding. Repeatedly was she on the point of making a
most solemn asseveration that never again, for a day, would she
leave her dear, dear children. The moanings of the suffering child,
seemed to rend her heart with anguish; and it appeared impossible
that she could ever forgive herself.

She now appreciated the value of such a friend as Mrs. Lawrence.


Her feelings were such, that she could do nothing for the afflicted
boy; could not even remain in the room, while he was under the
hands of the surgeon. Mrs. Lawrence was Dr. G——'s constant
assistant,—and indeed almost the sole nurse of the child; from the
hand of no one else would he willingly receive either food or
medicine. Mrs. North looked on Mrs. Lawrence with astonishment;
and could not but think, that with all her tenderness, there was a
hard spot in her heart, that enabled her to be useful in such a scene
of suffering. Mrs. North had no knowledge of that true christian
sympathy, firmness, and philosophy, that impels one to relieve,
instead of flying from suffering; and she dignified her own weak and
selfish indulgence by the name of sensibility.

"O, my dear friend, how can I ever be sufficiently grateful for your
kindness? My sensibilities are such, that it shatters my nerves to
pieces to witness suffering in any one—how much more in one's own
sweet infant! How must the dear boy suffer, were there no one to
help him but his poor, sensitive mother! It is really a misfortune to
have a heart so feelingly constituted!"

The little boy lingered several weeks in great pain,—and then his
liberated spirit took its flight from its decaying tenement. Three
months after, Mrs. North became the mother of her fifth child; and
as soon as she was able to go out, it was sent from home to nurse,
like all its predecessors,—and she started on a journey to visit her
parents. This journey was very well—very right; but Mrs. Lawrence
feared that the impression made by her recent trouble, was fast
fading away; that the rod of affliction would have no correcting
influence;—produce no favorable change, either in character or
conduct. When preparing to leave home, to have her mourning
dresses of the most elegant, fashionable, and becoming kind,
engrossed the whole woman, and left no room for any other thought
or feeling. How inconceivably obdurate may the heart, even of a
mother, be rendered by selfish indulgence!

The fears of Mrs. Lawrence were but too well founded. It was
October when Mrs. North returned from her visit to her parents; and
a few weeks after Mrs. Lawrence perceived there were great, and
unusual preparations making for another journey. But she asked no
questions. Her heart sickened; but she despaired of doing good, and
was weary of giving unheeded admonitions; weary of attempting to
touch a heart incased in the "triple mail" of vanity, selfishness, and
love of pleasure.

Without inquiry she soon learned from Mrs. North, that she and Mr.
North designed to spend the greater part of the winter in
Washington. Mr. North had business as far as Philadelphia; they had
both ever been anxious to visit the seat of government, and hear the
eloquence of the senate; so good an opportunity might never again
occur,—"and, really," Mrs. North added, "I have passed through
scenes so heart-rending, so wearing to my constitution, that I need
something more than ordinary, to restore me to myself again." She
could leave home with an easy heart; for the unfaithful, cruel
nursery-maid was dismissed from her service; and she had engaged
Mrs. Berry, Mrs. Lawrence's own good nurse, (at very high wages, it
was true,) to take care of her children, and superintend her
household while she should be absent. At the appointed time they
departed.

"Why will you thus grieve, my dear Ellen?" said Mr. Lawrence. "It is
utterly useless."
"I know it, Horace, yet how can I help it? O, how completely do the
love of pleasure, and the pride of fashion, destroy all the best
feelings of the heart!—all the finest sensibilities of our natures!—To
see a woman, capable of better things, thus bent on gratifying
herself, in despite of every call of duty, and warning of Providence,—
and leading an amiable husband to neglect every thing but herself, is
dreadful; and yet, it is for the poor neglected children I grieve. What
is to become of them? What can be expected of them?—thus
continually left to their own guidance."

"Nothing good, of course, Ellen. They are a set of untaught,


ungoverned, unmannered little bears; and must continue so, unless
they are so fortunate as to lose their mother, or she reform. But you
have done, and are still doing, all that a friend can do, under such
circumstances. Having, therefore, discharged your duty, be cheerful,
and borrow not troubles that properly belong to another."

Mrs. Lawrence received frequent letters from Mrs. North, filled with
glowing descriptions of what she was seeing, and hearing, and
doing; and wishes that her kind friend were with her to participate in
such pleasures—pleasures that would suit even the correct and
refined taste of Mrs. Lawrence,—they were so intellectual. She
frequently expressed regret that time flew so rapidly, as she dreaded
to leave scenes so replete with pleasure. In every letter she would
send kisses, or something equally valuable to her dear little ones;
but said she felt perfectly easy about them, under the care of good
Mrs. Berry; and having the eye of the best of friends frequently upon
them.

Mr. and Mrs. North had been absent something more than two
months, when Mr. Lawrence received a letter from the former,
requesting the loan of a hundred or two of dollars. Mr. North said he
had written to Mr. Mason for a remittance; but having a payment to
make out, he had not been able to forward it to him. If Mr. Lawrence
would oblige him, doubtless Mr. Mason would in a short time be able
to reimburse him; if not, Mr. North would do so, immediately on his
return to L——.

The very day this letter was received, Mr. Mason called at the office
of Mr. Lawrence, to consult with him concerning what was to be
done in the present juncture of Mr. North's affairs,—and as a
preliminary measure, to secure to himself the store and goods it
contained, which would scarcely be sufficient to satisfy his just
demands. Mr. North's debts were numerous, and his creditors were
becoming clamorous; and although Mr. Mason had written to him, he
seemed not to be alarmed, and had given no directions.

Mr. Lawrence was unwilling to have any thing to do in this unhappy


business; yet he could not refuse to assist an industrious and honest
young man, who was in danger of losing the earnings of several
years' close attention to business, should he refuse to lend his
assistance as a lawyer. He therefore did what his sense of justice
and duty demanded, though he pitied his inconsiderate friend; and
he immediately wrote him, informing him of what was done,—and
inclosing (which he knew must be a gift) a draft for the money of
which Mr. North had requested the loan. He concluded his letter, by
urging his friend's instant return to L——, if it were yet possible to
give his affairs a favorable turn.

Three days after this, all property that could be found, belonging to
Mr. North, was seized by his creditors.

"My dear Horace," said the greatly agitated Mrs. Lawrence, "what
will Alpheus and Anna do?—what can they do?"

"They must begin the world again, upon better principles," said Mr.
Lawrence. "I hope they will learn wisdom from experience."

"But what can we do for them, my dear husband? You will receive
them here when they arrive? Anna will feel so wretchedly!"

"For a day or two, certainly, if you wish it, my love."


"And for no longer? The contrast will be so striking, they will be
overwhelmed! We must afford them all the assistance and
consolation in our power?"

"Certainly!—but let us assist them in a rational way. They must feel


the blow, and its consequences. We could do nothing to prevent it,
short of utter ruin to ourselves. And it is necessary they should feel
out; for nothing less could prove a cure for their folly. They must
taste the bitter fruits of their extravagance. They must learn to live
within their income, however small; and practise the self-denial that
poverty demands. They must learn to be industrious, and support
themselves by their own exertions."

"Poor Alpheus!—poor Anna!" ejaculated Mrs. Lawrence.

"If Alpheus had possessed either common firmness, or common


prudence," said Mr. Lawrence, "or would Anna have listened to the
admonitions, or followed the example of the best and kindest of
friends, your sympathies would never have been thus called upon."

"O, make no comparisons,—it would be unjust," said Mrs. Lawrence.


"Anna was never blessed with the instructions of such a father, or
the example of such a mother as mine."

"True—and let us hope that this event will only prove a 'blessing in
disguise,' to teach her what she would learn in no other way. Let us
hope it will be for the best."

"O, may it prove so indeed!" said Mrs. Lawrence. "May the


misguided and unfortunate Anna learn, that to be a fashionable
woman, is not the way to be either respectable, or useful, or happy."
S. H.

For the Southern Literary Messenger.

HINTS TO STUDENTS OF GEOLOGY.

No. II.

BY PETER A. BROWNE, ESQ.

The most effectual way to guard against the dangerous tendency of


theories is to collect and lay open to examination at one view some
of the most celebrated of them, with which mankind have from time
to time been furnished. Several of these will be found to be so
obscure that astonishment is excited that they were ever dignified
with the name of philosophy; others are so entirely inconsistent and
at the same time have such equal claims to plausibility that they
mutually confute each other; a few are so intimately connected with
the truths that the study of geology and astronomy have displayed
that it is difficult to escape the hazardous abyss into which they
would lead—but the greater part are the effusions of fancy, and
resemble more the emanations of a feverish or disordered brain than
the cool dictates of reason and common sense. It is confidently
believed that the student who will attentively read them all, will be
very slow to adopt any one of the number.

The most ancient Indian and Egyptian philosophers agreed in rightly


ascribing the creation of the world to an OMNIPOTENT and INFINITE
BEING, and it is a curious fact that they represented him as having
repeatedly destroyed and reproduced the world and its inhabitants.
In "the Institutes of Menu," the sacred volume of the Hindoos, which
were written eight hundred and eighty-eight years B.C., are the
following verses:

"The Being whose powers are incomprehensible, having created


me, (Menu,) and this universe, again became absorbed in the
Supreme Spirit, changing the time of energy for the hour of
repose."

"When this power awakes, then has this world its full expansion;
but when he slumbers with a tranquil spirit, then the whole
system fades away."

It is perfectly ascertained that the Greeks borrowed this idea of a


former successive destruction and renovation of this world from the
Egyptians. Plutarch tells us that it was the theme of one of the
hymns of Orpheus; and it is well known that Orpheus, although a
Greek poet, gained all his knowledge of astronomy, divinity, music
and poetry in Egypt.

This most ancient Pagan theologist believed that all things were
created by a Being whom he represents as invisible and
incomprehensible, and to whom he has given the appellation of THE
COUNSELLOR of LIGHT and SOURCE of LIFE; but he has degraded this
sublime idea of the Almighty by supposing that from an egg, the
progeny of chance, all mankind have been produced.

The philosopher Leucippus, who was also a Grecian, taught that "the
universe was infinite; that it was in part a plenum and in part a
vacuum—that the plenum contained innumerable corpuscles or
atoms of various figures, which, falling into the vacuum, struck
against each other; and hence arose a variety of curvilinear motions,
which continued till at length atoms of similar forms met together,
and bodies were produced. The primary atoms being specifically of
equal weight, and not being able, on account of their multitude, to
move in circles, the smaller rose to the exterior parts of the vacuum,
whilst the larger (entangling themselves,) formed a spherical shell,
which revolved about its centre and which included within it all kinds
of bodies. This central mass was gradually increased by a perpetual
accession of particles from the surrounding shell, till at last (says
Leucippus) the EARTH was formed. In the mean time the spherical
shell was continually supplied with new bodies, which, in its
revolution, it gathered from without. Of the particles thus collected
in the spherical shell, some in their combination formed humid
masses, which, by their circular motion, gradually became dry and
were at length ignited and became STARS. The SUN was formed in the
same manner in the exterior surface of the shell; and the moon in its
interior surface. In this manner the universe was formed."—Such a
jargon of learned nonsense requires no comment; yet Leucippus had
for a time the reputation of possessing superior wisdom!

Epicurus adopted the idea of Leucippus as to the atoms, and


imagined that they moved obliquely, and Democritus bestowed on
them animation. Gassendi contended for atoms and a void, and
Descartes asserted a plenum and a subtle matter, which revolving in
vortices was under the direction of an intelligent being.

Hippasus and Heraclitus maintained that the being who was the
author of all things was fire.

Many of the ancient philosophers believed this world to be eternal—


among these may perhaps be ranked Pythagoras, Aristotle, Socrates
and Plato.

Zeno advocated with great zeal the theory of "two principles," spirit
and matter, one active and the other passive.

Mahomet maintained that the world was created in two days, and
the mountains were afterwards placed upon it; and that during these
and two additional days the inhabitants were formed; and in two
more the seven heavens were created.
The waters of the deluge are ridiculously represented by him as
being poured out of an oven. The Alcoran says that all men were
drowned except Noah and his family; and that at an appointed time
God said, "O earth swallow up the waters!" "and thou, O heaven,
withhold thy rain!" and immediately the waters abated. Is it not
surprising that so many thousands should have adopted this theory.

Mr. Thomas Burnet was a man of genius and taste, a learned divine
and a philosopher; but he suffered his imagination to take the lead
of his judgment. He was the friend and object of admiration of
Addison. His work is entitled, "The sacred theory of the earth,
containing an account of the origin of the earth and of all the
general changes which it hath already undergone or is to undergo till
the consummation of all things." He taught that originally the earth
was a fluid mass, composed of various materials; that of these the
heaviest descended to the centre, and formed a hard and solid body
—that the waters took their station round this body—and that all
lighter fluids rose above the water, forming first a strata of oily
matter and next a strata of air—that the air was then impure,
containing great quantities of earthy particles, which gradually
subsided and composed a crust of earth and oil—that this crust was
the first habitable part of the earth and abode of man and other
animals—that the surface was uniform, no mountains nor seas nor
other inequalities were to be seen—that in this state it remained
about sixteen centuries; by which time the heat of the sun gradually
drying the crust, produced cracks or fissures, which gradually
penetrating deeper and deeper, finally perforated the entire crust—
that in an instant the whole split in pieces and fell into the great
abyss of water. This (says Burnet) was the UNIVERSAL DELUGE!—That
with these masses of earth were carried vast quantities of air, and
the masses dashing violently against each other, accumulated and
divided so irregularly, that great cavities filled with air were left
between them—that the waters gradually opened passages into
these cavities. In proportion as they were filled with water, the
surface of the earth began to discover itself in the most elevated
places, till at last the waters appeared no where but in those
extensive valleys which now contain the ocean—that islands and sea
rocks are small fragments, and continents are large masses of this
ancient crust.

His theory was attacked and pretty roughly handled by his


cotemporaries Erasmus Warren, John Keill and McFlamstead, the
astronomer royal.

How Burnet could imagine that man and other land animals could
have inhabited an earth which had a plane surface, it is difficult to
conceive. If these animals resembled those that at present inhabit
this planet, they could not have subsisted without water; and if this
element was supplied by rain, and the earth had no inequalities of
surface, the whole earth must have been covered by a sea or at
least been a swamp. It was perhaps this reflection that generated
the idea of Demailet, that man was originally a fish.

Mr. Robinson was a respectable clergyman of the English established


church. In 1694 he wrote what he calls an anatomical description of
the earth. He contends that matter at first consisted of innumerable
particles of divers figures and different qualities; these he obliges to
move about in a confused manner until the world was finally
created, by the infusion of a vital spirit. He is of opinion that the
earth is a great animal; that it has a skin, flesh, blood, &c. He lays it
down as incontrovertible, that the centre contains a vast cavity of a
multangular figure, containing crude and indigested matter, endued
with contrary qualities, and causing much strife and contention.
When the airy particles prevail, they cause hurricanes; when the
fiery ones are uppermost, earthquakes and volcanoes are the result.
The mountain chains he takes to be real ribs, and finally he seriously
tells us, that this vast animal is subject to fevers, agues, and other
distempers. Yet Robinson had his day, and all his readers did not
appear to consider him a lunatic.

Mr. John Woodward was a classical scholar and an eminent


physician. He was also a man of much observation; but he was
infected with the disease of theory-making.

He agreed in part with Burnet, but refined upon him.

He contended that the waters of the ocean were aided by a supply


from the central parts of the earth in effecting the general deluge.
He also believed that the whole fabric was dissolved instead of the
crust, as taught by Burnet. He said, that in order to assist in this
general dissolution, the power of attraction, of cohesion, was
suddenly suspended. Every thing being thus dissolved and jumbled
in one common mass, a precipitation took place according to the
laws of gravitation. Locke pronounced a panegyric upon this theory!

Mr. William Whiston, a celebrated astronomer and learned divine,


also gave loose to his fancy in an extraordinary manner.

He was of opinion that the ancient chaos from which this earth
originated, was the atmosphere of a comet; that the detail given by
Moses is not of the creation of the world, but of its passage from the
state of a comet to that of a planet, so as to make it habitable.

In the beginning, (says Mr. Whiston,) "God created the universe,"


but the earth was then an uninhabitable comet, surrounded by
darkness; and hence, he says, we are told that, "darkness covered
the face of the deep;" that it was composed of heterogeneous
materials, having its centre occupied with a globular hot nucleus of
about two thousand leagues in diameter, round which was an
extensive mass of thick fluid; that this fluid contained few solid
particles, and still less of water or air; that on the first day of the
creation, the eccentric orbit of the comet was exchanged for an
ellipsis nearly circular, and every thing instantly assumed its proper
place. The different materials arranged themselves according to the
laws of gravity, and the annual motion of the earth then began. That
the centre of the earth is a solid body, still retaining the heat of the
former comet; that round this is a heavy fluid and a body of water in
concentric circles, upon the latter of which the earth is founded; that
after the atmosphere of the earth had been thus freed from the
earthy particles of that of the comet, a pure air remained, through
which the rays of the sun instantly penetrated, when God said "let
there be light." He ascribes to the precipitation with which the earth
was formed, the great difference now found in the materials that
compose its crust, and the mountains and vallies to the laws of
gravity. He maintains that before the deluge the water of the present
ocean was dispersed over the earth in small caverns, and that the
mountains were at greater distances, and not so large as at present;
but that the earth was a thousand times more fertile, and contained
a great many more inhabitants, whose lives were ten times longer.
All this he is of opinion was effected by the superior heat of the
nucleus; but that this heat augmented the passions and destroyed
the virtue of man and the sagacity of other animals, and caused the
universal sentence of death which was inflicted by the deluge. He
says, that that event was occasioned by a change in the inclination
of the earth's axis, occasioned by the tail of a comet meeting with
the earth, in returning from its perihelium, when "the cataracts of
heaven were opened." Newton denied that there was any thing in
astronomy wherefrom to presume this change of inclination. But the
celebrated Count de Buffon left his predecessors far behind, after
premising that the sphere of the sun's attraction is not limited by the
orbits of the planets, but extends indefinitely, always decreasing
according to the squares of the augmented distances: that the
comets which escape our sight in the heavenly regions are, like the
planets, subject to the attraction of the sun, and by it their motions
are regulated: that all these bodies (the directions of which are so
various,) move round the sun, and describe areas proportioned to
their periods; the planets in ellipses, more or less circular, and the
comets in narrow ellipses of vast extent.—He asserts, that comets
run through the system in all directions; but that the inclinations of
the planes of their orbits are so very different, that though, like the
planets, they are subject to the laws of attraction, they have nothing
in common with regard to their progressive or impulsive motions,
but appear in this respect to be absolutely independent of each
other.
He then conjectures that a comet, falling obliquely into the body of
the sun, drove off a part from its surface, and communicated to it a
violent impulsive force. This effect he supposes was produced at the
time when God is said, by Moses, to have "separated the light from
the darkness," by which Buffon understands a real, physical
separation; the opaque bodies of the planets being detached from
the luminous matter of which he supposed the sun to be composed,
and he imagined that the part struck off was one six hundred and
fiftieth part of the sun's body.

He informs us that this matter issued from the sun, not in the form
of globes, but of liquid torrents of fire; and that a projectile motion
having been communicated by the stroke of the comet, the light
particles separated from the dense, which, by their mutual
attractions, formed globes of different solidities; and that the
projectile force being proportioned to the density of the particles,
determined the respective distances from the sun to which they
would be carried. Our author having thus (at one blow of a comet)
created the planets out of the superabundant materials of the sun,
and having driven them to the distances of their spheres from that
body, was put to a great straight to prevent them from obeying the
law of projectiles, in returning whence they issued, and in obliging
them to revolve round a common centre. This part of his theory is
very lame indeed. He first unphilosophically ascribes this change of
direction to an acceleration of velocity; and secondly, the
acceleration he very erroneously supposed would take place by the
anterior particles attracting and hastening the posterior ones, and by
the posterior ones pushing forward or hastening the anterior ones.
But appearing to be unsatisfied himself with this explanation, he
next makes the shock of the comet remove the sun from its former
situation—so that when the planets, according to the law of
projectiles, returned to the place from whence they had departed,
they did not enter into the sun again, who had thus fortunately
stepped out of their way, or Buffon's ingenious creation would have
been entirely destroyed.
But to proceed. He supposes that the earth, having acquired its
present shape by its motion while in a liquid state, the fire was
eventually extinguished by its rapid passage through space, or after
having consumed all the combustible matter it contained. Mr. Buffon
acknowledges that the constituent parts of the earth's crust are now
of very different densities; but he gives no satisfactory explanation
for the change which must have taken place, if as he supposed, they
were once homogeneous. Nor does he account for the separation of
the land from the water. It is true he leaves us to infer that such a
separation took place; for he says, that "the motion of the waters is
coeval with time." He also says, that the waters occupy the lowest
grounds, and that all the mountains have been formed at the bottom
of the sea, by means of currents and tides. His primeval world must
therefore have had cavities, in which the waters were preserved.

Such is the theory of the Count de Buffon, a gentleman of great


ingenuity, taste and erudition; whose works, so long as he confined
himself to facts and reasoning, have been universally admired; but
whose theories have been as much ridiculed by others as he
ridiculed those of Burnet and Whiston. Soon after the publication of
this theory, Buffon was summoned before the Faculty of Theology at
Paris, and there informed that fourteen propositions in his works
were reprehensible and contrary to the creed of the church. One of
these, which related to geology, was, "That the waters of the sea
were concerned in producing the mountains and valleys of the land."
And it is curious to remark that this, which was almost the only
correct geological proposition in the whole work, Buffon publicly
renounced! Upon this theory of Buffon I would take leave, upon the
highest modern authority, further to observe, that "from a long
series of observations, made with powerful telescopes, Herschel
discovered that the solar light and heat do not emanate from the
body or nucleus of the sun, but from certain phosphoric and
pyrophoric clouds, which are produced and developed in its
atmosphere. That this immense ocean of light is violently agitated
over its whole surface, causing those corrugations of its disc which
he has so well described,—and which indeed, may be observed
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like