~coder_kalyan/art-of-the-diff

299a608576d6dab32422d4c6bf2a4cce52330b9e — Kalyan Sriram 2 years ago
Initial commit
A  => .gitignore +1 -0
@@ 1,1 @@
book

A  => book.toml +6 -0
@@ 1,6 @@
[book]
authors = ["Kalyan Sriram"]
language = "en"
multilingual = false
src = "src"
title = "The Art of the Diff"

A  => src/README.md +20 -0
@@ 1,20 @@
# Introduction

This is a book about version control with [Git](https://git-scm.com) - by far, the most popular version control system in use today. 

Git, when used correctly, is an incredibly powerful tool for the developer, creative writer, or power user. Unfortunately, many people develop bad habits due to fragmented or incorrect documentation and bad practices. *The Art of the Diff* was written to address these issues:
1. The official [Pro Git Book](https://git-scm.com/book/en/v2) is a great learning resource. However, it's also quite long. As a result, many people end up not reading it at all.
2. 3rd party documentation about Git is fragmented and confusing.
3. Many projects, even professional ones, end up using Git in a sloppy way.
4. Services such as Github and Gitlab, although influential in popularizing open source development and making Git easy to use, have promoted sloppy practices.
5. Git is, fundamentally, a **distributed** VCS. However, the most common way of using it today does not make use of this feature.

If you're a total newbie to Git, this book will teach you how to use it, *the right way*. If you've had the bad luck of learning bad Git practices, I hope you'll come away with a better understanding of the tool.

**Note:** this book is in early development. If you want to help out, see the [contributing information](#about-and-contributing).

## About the author
TODO

## About and Contributing
This work is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). The source code is [available here](https://git.sr.ht/~coder_kalyan/art-of-the-diff). If you're interested in contributing, send a patch, or email me (Kalyan Sriram) at <mailto:kalyan@coderkalyan.com>. You can also send me a message on IRC - I'm `coder_kalyan` at `irc.libera.chat`.

A  => src/SUMMARY.md +14 -0
@@ 1,14 @@
# Summary

- [Introduction](README.md)
- [Getting Started](getting-started/README.md)
	- [Why version control?](getting-started/why.md)
	- [What is Git?](getting-started/git.md)
	- [Installation](getting-started/installation.md)
	- [First Steps](getting-started/first-steps.md)
- [The Basics, Explained](basics/README.md)
	- [Diffs](basics/diffs.md)
	- [The Staging Area](basics/staging.md)
	- [Commits](basics/commits.md)
- [Remotes](remotes/README.md)
	- [Bazaars and Cathedrals](remotes/bazaar.md)

A  => src/basics/README.md +1 -0
@@ 1,1 @@
# The Basics, Explained

A  => src/basics/commits.md +1 -0
@@ 1,1 @@
# Commits

A  => src/basics/diffs.md +1 -0
@@ 1,1 @@
# Diffs

A  => src/basics/staging.md +1 -0
@@ 1,1 @@
# The Staging Area

A  => src/getting-started/README.md +1 -0
@@ 1,1 @@
# Getting Started

A  => src/getting-started/add.md +1 -0
@@ 1,1 @@
# git add

A  => src/getting-started/first-steps.md +1 -0
@@ 1,1 @@
# First Steps

A  => src/getting-started/git.md +6 -0
@@ 1,6 @@
# What is Git?

[Git](https://git-scm.com) is a [free and open source](https://www.fsf.org/about/what-is-free-software) _**distributed** version control system_. Today, it's by far the most popular VCS program in use. 

### A bit of history
Git was created back in 2005 by Linus Torvalds, the original creator of the Linux operating system kernel, to track 

A  => src/getting-started/installation.md +60 -0
@@ 1,60 @@
# Installation

Installing git is pretty straight forward. Below you can find installation information for popular operating systems. Don't see your operating system listed? Send us a [patch](mailto:~coder_kalyan/public-inbox@lists.sr.ht)!

## Arch Linux
`sudo pacman -Syu --needed git perl-authen-sasl perl-io-socket-ssl`

## Alpine Linux
`sudo apk add git git-email`

## CentOS
`sudo yum install git git-email`

## Debian
`sudo apt install git git-email`

## Fedora
`sudo dnf install git git-email`

## FreeBSD
`pkg install git`

## Gentoo
`emerge dev-vcs/git`

## Guix
`guix package -i git git:send-email`

## macOS
Just run `git --version`. If it's not already installed, it should prompt you on how to install it.
You might have to install some perl SSL modules as well (for email support, which we'll use later).
`sudo -H cpan Net::SMTP::SSL IO::Socket::SSL`
If someone can verify this, please send a patch!

## NixOS
`nix-env -iA nixos.gitAndTools.gitFull`

## OmniOS
`pkg install git`

## OpenBSD
`pkg_add git p5-Authen-SASL p5-Net-SMTP-SSL`

## openSUSE
`sudo zypper install git-email`

## pkgsrc
`sudo pkg_add git`

## Solus
`sudo eopkg install git`

## Ubuntu
`sudo apt install git git-email`

## Void Linux
`sudo xbps-install -S git`

## Microsoft Windows
Install the official bundle from [git-scm.com](https://git-scm.com/download/windows).

A  => src/getting-started/why.md +3 -0
@@ 1,3 @@
# Why version control?

If you've never touched Git or other version control software before, you might be wondering what the point of it all is. Simply put, version control systems allow you to keep track of the state of your project through time. This project could house any kind of content, really - but it's most popular for storing software projects. If you're the only one working on a project, version control allows you to create backups of your progress over time, roll them back if something goes wrong, and organize your features and releases over time. If you're collaborating with other people, which is often the case with most software, version control will also help you keep track of contributions from different developers and fix conflicts when files are changed by multiple people.

A  => src/remotes/README.md +1 -0
@@ 1,1 @@
# Remotes

A  => src/remotes/bazaar.md +1 -0
@@ 1,1 @@
# Bazaars and Cathedrals