--- user-manual.html 2021-04-03 11:58:44.937710623 +0700 +++ user-manual.patched.html 2021-04-03 12:01:01.634421455 +0700 @@ -1,17 +1,17 @@ -Git User Manual

Git User Manual


Table of Contents

1. Repositories and Branches
How to get a Git repository
How to check out a different version of a project
Understanding History: Commits
Understanding history: commits, parents, and reachability
Understanding history: History diagrams
Understanding history: What is a branch?
Manipulating branches
Examining an old version without creating a new branch
Examining branches from a remote repository
Naming branches, tags, and other references
Updating a repository with git fetch
Fetching branches from other repositories
2. Exploring Git history
How to use bisect to find a regression
Naming commits
Creating tags
Browsing revisions
Generating diffs
Viewing old file versions
Examples
Counting the number of commits on a branch
Check whether two branches point at the same history
Find first tagged version including a given fix
Showing commits unique to a given branch
Creating a changelog and tarball for a software release
Finding commits referencing a file with given content
3. Developing with Git
Telling Git your name
Creating a new repository
How to make a commit
Creating good commit messages
Ignoring files
How to merge
Resolving a merge
Getting conflict-resolution help during a merge
Undoing a merge
Fast-forward merges
Fixing mistakes
Fixing a mistake with a new commit
Fixing a mistake by rewriting history
Checking out an old version of a file
Temporarily setting aside work in progress
Ensuring good performance
Ensuring reliability
Checking the repository for corruption
Recovering lost changes
4. Sharing development with others
Getting updates with git pull
Submitting patches to a project
Importing patches to a project
Public Git repositories
Setting up a public repository
Exporting a Git repository via the Git protocol
Exporting a git repository via HTTP
Pushing changes to a public repository
What to do when a push fails
Setting up a shared repository
Allowing web browsing of a repository
How to get a Git repository with minimal history
Examples
Maintaining topic branches for a Linux subsystem maintainer
5. Rewriting history and maintaining patch series
Creating the perfect patch series
Keeping a patch series up to date using git rebase
Rewriting a single commit
Reordering or selecting from a patch series
Using interactive rebases
Other tools
Problems with rewriting history
Why bisecting merge commits can be harder than bisecting linear history
6. Advanced branch management
Fetching individual branches
git fetch and fast-forwards
Forcing git fetch to do non-fast-forward updates
Configuring remote-tracking branches
7. Git concepts
The Object Database
Commit Object
Tree Object
Blob Object
Trust
Tag Object
How Git stores objects efficiently: pack files
Dangling objects
Recovering from repository corruption
The index
8. Submodules
Pitfalls with submodules
9. Low-level Git operations
Object access and manipulation
The Workflow
working directory → index
index → object database
object database → index
index → working directory
Tying it all together
Examining the data
Merging multiple trees
Merging multiple trees, continued
10. Hacking Git
Object storage format
A birds-eye view of Git’s source code
11. Git Glossary
Git explained
A. Git Quick Reference
Creating a new repository
Managing branches
Exploring history
Making changes
Merging
Sharing your changes
Repository maintenance
B. Notes and todo list for this manual
Todo list
+Git User Manual

Git User Manual


Table of Contents

1. Introduction
2. Repositories and Branches
How to get a Git repository
How to check out a different version of a project
Understanding History: Commits
Understanding history: commits, parents, and reachability
Understanding history: History diagrams
Understanding history: What is a branch?
Manipulating branches
Examining an old version without creating a new branch
Examining branches from a remote repository
Naming branches, tags, and other references
Updating a repository with git fetch
Fetching branches from other repositories
3. Exploring Git history
How to use bisect to find a regression
Naming commits
Creating tags
Browsing revisions
Generating diffs
Viewing old file versions
Examples
Counting the number of commits on a branch
Check whether two branches point at the same history
Find first tagged version including a given fix
Showing commits unique to a given branch
Creating a changelog and tarball for a software release
Finding commits referencing a file with given content
4. Developing with Git
Telling Git your name
Creating a new repository
How to make a commit
Creating good commit messages
Ignoring files
How to merge
Resolving a merge
Getting conflict-resolution help during a merge
Undoing a merge
Fast-forward merges
Fixing mistakes
Fixing a mistake with a new commit
Fixing a mistake by rewriting history
Checking out an old version of a file
Temporarily setting aside work in progress
Ensuring good performance
Ensuring reliability
Checking the repository for corruption
Recovering lost changes
5. Sharing development with others
Getting updates with git pull
Submitting patches to a project
Importing patches to a project
Public Git repositories
Setting up a public repository
Exporting a Git repository via the Git protocol
Exporting a git repository via HTTP
Pushing changes to a public repository
What to do when a push fails
Setting up a shared repository
Allowing web browsing of a repository
How to get a Git repository with minimal history
Examples
Maintaining topic branches for a Linux subsystem maintainer
6. Rewriting history and maintaining patch series
Creating the perfect patch series
Keeping a patch series up to date using git rebase
Rewriting a single commit
Reordering or selecting from a patch series
Using interactive rebases
Other tools
Problems with rewriting history
Why bisecting merge commits can be harder than bisecting linear history
7. Advanced branch management
Fetching individual branches
git fetch and fast-forwards
Forcing git fetch to do non-fast-forward updates
Configuring remote-tracking branches
8. Git concepts
The Object Database
Commit Object
Tree Object
Blob Object
Trust
Tag Object
How Git stores objects efficiently: pack files
Dangling objects
Recovering from repository corruption
The index
9. Submodules
Pitfalls with submodules
10. Low-level Git operations
Object access and manipulation
The Workflow
working directory → index
index → object database
object database → index
index → working directory
Tying it all together
Examining the data
Merging multiple trees
Merging multiple trees, continued
11. Hacking Git
Object storage format
A birds-eye view of Git’s source code
12. Git Glossary
Git explained
A. Git Quick Reference
Creating a new repository
Managing branches
Exploring history
Making changes
Merging
Sharing your changes
Repository maintenance
B. Notes and todo list for this manual
Todo list
-

+

Chapter 1. Introduction

Git is a fast distributed revision control system.

This manual is designed to be readable by someone with basic UNIX command-line skills, but no previous knowledge of Git.

-

Chapter 1, Repositories and Branches and Chapter 2, Exploring Git history explain how +

Chapter 2, Repositories and Branches and Chapter 3, Exploring Git history explain how to fetch and study a project using git—​read these chapters to learn how to build and test a particular version of a software project, search for regressions, and so on.

People needing to do actual development will also want to read -Chapter 3, Developing with Git and Chapter 4, Sharing development with others.

+Chapter 4, Developing with Git and Chapter 5, Sharing development with others.

Further chapters cover more specialized topics.

Comprehensive reference documentation is available through the man pages, or git-help(1) command. For example, for the command @@ -26,7 +26,7 @@

Finally, see Appendix B, Notes and todo list for this manual for ways that you can help make this manual more complete.

-

Chapter 1. Repositories and Branches

+

Chapter 2. Repositories and Branches

How to get a Git repository

@@ -139,7 +139,7 @@ has that commit at all). Since the object name is computed as a hash over the contents of the commit, you are guaranteed that the commit can never change without its name also changing.

-

In fact, in Chapter 7, Git concepts we shall see that everything stored in Git +

In fact, in Chapter 8, Git concepts we shall see that everything stored in Git history, including file data and directory contents, is stored in an object with a name that is a hash of its contents.

Understanding history: commits, parents, and reachability

@@ -351,7 +351,7 @@ git-config(1) for details.)

-
- -

Chapter 4. Sharing development with others

+

Chapter 5. Sharing development with others

Getting updates with git pull

@@ -1492,7 +1492,7 @@ and can be updated using git-fetch(1); you can track other public trees using git-remote(1) to set up a "remote" and git-fetch(1) to keep them up to date; see -Chapter 1, Repositories and Branches.

+Chapter 2, Repositories and Branches.

Now create the branches in which you are going to work; these start out at the current tip of origin/master branch, and should be set up (using the --track option to git-branch(1)) to merge changes in from @@ -1679,7 +1679,7 @@

- -

Chapter 6. Advanced branch management

+

Chapter 7. Advanced branch management

Fetching individual branches

@@ -2012,7 +2012,7 @@ the refspec syntax.

-

Chapter 7. Git concepts

+

Chapter 8. Git concepts

Git is built on a small number of simple but powerful ideas. While it is possible to get things done without understanding them, you will find @@ -2141,7 +2141,7 @@ between two related tree objects, since it can ignore any entries with identical object names.

(Note: in the presence of submodules, trees may also have commits as -entries. See Chapter 8, Submodules for documentation.)

+entries. See Chapter 9, Submodules for documentation.)

Note that the files all have mode 644 or 755: Git actually only pays attention to the executable bit.

@@ -2258,7 +2258,7 @@ objects. They are not a problem.

The most common cause of dangling objects is that you’ve rebased a branch, or you have pulled from somebody else who rebased a branch—​see -Chapter 5, Rewriting history and maintaining patch series. In that case, the old head of the original +Chapter 6, Rewriting history and maintaining patch series. In that case, the old head of the original branch still exists, as does everything it pointed to. The branch pointer itself just doesn’t, since you replaced it with another one.

There are also other situations that cause dangling objects. For @@ -2437,7 +2437,7 @@ information as long as you have the name of the tree that it described.

-

Chapter 8. Submodules

Table of Contents

Pitfalls with submodules
+

Chapter 9. Submodules

Table of Contents

Pitfalls with submodules

Large projects are often composed of smaller, self-contained modules. For example, an embedded Linux distribution’s source tree would include every @@ -2629,7 +2629,7 @@ warning about not being able switch from a dirty branch.

-

Chapter 9. Low-level Git operations

+

Chapter 10. Low-level Git operations

Many of the higher-level commands were originally implemented as shell scripts using a smaller core of low-level Git commands. These can still @@ -2891,7 +2891,7 @@

and that is what higher level git merge -s resolve is implemented with.

-

Chapter 10. Hacking Git

+

Chapter 11. Hacking Git

This chapter covers internal details of the Git implementation which probably only Git developers need to understand.

@@ -3072,7 +3072,7 @@ itself!

-

Chapter 11. Git Glossary

Table of Contents

Git explained
+

Chapter 12. Git Glossary

Table of Contents

Git explained

Git explained