My First Object Walk
-2024-01-02 +2024-01-08Reviewing Patches in the Git Project
-2024-01-02 +2024-01-08Submitting Patches
-2024-01-02 +2024-01-08Tools for developing Git
-2024-01-02 +2024-01-08Everyday Git With 20 Commands Or So
-2024-01-02 +2024-01-08DESCRIPTION
Incorporates changes from the named commits (since the time their
histories diverged from the current branch) into the current
-branch. This command is used by git pull to incorporate changes
+branch. This command is used by git pull
to incorporate changes
from another repository and can be used by hand to merge changes
from one branch into another.
Assume the following history exists and the current branch is
-"master
":
master
: A---B---C topic
/
D---E---F---G master
Then "git merge topic
" will replay the changes made on the
+
Then git merge topic
will replay the changes made on the
topic
branch since it diverged from master
(i.e., E
) until
its current commit (C
) on top of master
, and record the result
in a new commit along with the names of the two parent commits and
@@ -787,18 +787,18 @@
DESCRIPTION
/ \ D---E---F---G---H masterThe second syntax ("git merge --abort
") can only be run after the
-merge has resulted in conflicts. git merge --abort will abort the
-merge process and try to reconstruct the pre-merge state. However,
-if there were uncommitted changes when the merge started (and
-especially if those changes were further modified after the merge
-was started), git merge --abort will in some cases be unable to
-reconstruct the original (pre-merge) changes. Therefore:
Warning: Running git merge with non-trivial uncommitted changes is +
A merge stops if there’s a conflict that cannot be resolved
+automatically or if --no-commit
was provided when initiating the
+merge. At that point you can run git merge --abort
or git merge
+--continue
.
git merge --abort
will abort the merge process and try to reconstruct
+the pre-merge state. However, if there were uncommitted changes when the
+merge started (and especially if those changes were further modified
+after the merge was started), git merge --abort
will in some cases be
+unable to reconstruct the original (pre-merge) changes. Therefore:
Warning: Running git merge
with non-trivial uncommitted changes is
discouraged: while possible, it may leave you in a state that is hard to
back out of in the case of a conflict.
The third syntax ("git merge --continue
") can only be run after the
-merge has resulted in conflicts.
OPTIONS
If --log
is specified, a shortlog of the commits being merged
will be appended to the specified message.
The git fmt-merge-msg command can be -used to give a good default for automated git merge +
The git fmt-merge-msg
command can be
+used to give a good default for automated git merge
invocations. The automated message can include the branch description.
OPTIONS
present, apply it to the worktree.If there were uncommitted worktree changes present when the merge
-started, git merge --abort will in some cases be unable to
+started, git merge --abort
will in some cases be unable to
reconstruct these changes. It is therefore recommended to always
-commit or stash your changes before running git merge.
git merge --abort is equivalent to git reset --merge when
+commit or stash your changes before running git merge
.
git merge --abort
is equivalent to git reset --merge
when
MERGE_HEAD
is present unless MERGE_AUTOSTASH
is also present in
-which case git merge --abort applies the stash entry to the worktree
-whereas git reset --merge will save the stashed changes in the stash
+which case git merge --abort
applies the stash entry to the worktree
+whereas git reset --merge
will save the stashed changes in the stash
list.
OPTIONS
- After a git merge stops due to conflicts you can conclude the
- merge by running git merge --continue (see "HOW TO RESOLVE
+ After a git merge
stops due to conflicts you can conclude the
+ merge by running git merge --continue
(see "HOW TO RESOLVE
CONFLICTS" section below).
PRE-MERGE CHECKS
Before applying outside changes, you should get your own work in good shape and committed locally, so it will not be clobbered if there are conflicts. See also git-stash(1). -git pull and git merge will stop without doing anything when -local uncommitted changes overlap with files that git pull/git -merge may need to update.
git pull
and git merge
will stop without doing anything when
+local uncommitted changes overlap with files that git pull
/git
+merge
may need to update.To avoid recording unrelated changes in the merge commit,
-git pull and git merge will also abort if there are any changes
+git pull
and git merge
will also abort if there are any changes
registered in the index relative to the HEAD
commit. (Special
narrow exceptions to this rule may exist depending on which merge
strategy is in use, but generally, the index must match HEAD.)
If all named commits are already ancestors of HEAD
, git merge
+
If all named commits are already ancestors of HEAD
, git merge
will exit early with the message "Already up to date."
PRE-MERGE CHECKS
FAST-FORWARD MERGE
Often the current branch head is an ancestor of the named commit.
-This is the most common case especially when invoked from git
-pull: you are tracking an upstream repository, you have committed
+This is the most common case especially when invoked from git
+pull
: you are tracking an upstream repository, you have committed
no local changes, and now you want to update to a newer upstream
revision. In this case, a new commit is not needed to store the
combined history; instead, the HEAD
(along with the index) is
@@ -1381,7 +1381,7 @@
HOW CONFLICTS ARE PRESENTED
Barbie’s remark on your side. The only thing you can tell is that your side wants to say it is hard and you’d prefer to go shopping, while the other side wants to claim it is easy.An alternative style can be used by setting the "merge.conflictStyle" +
An alternative style can be used by setting the merge.conflictStyle
configuration variable to either "diff3" or "zdiff3". In "diff3"
style, the above conflict may look like this:
HOW TO RESOLVE CONFLICTS
Resolve the conflicts. Git will mark the conflicts in
the working tree. Edit the files into shape and
- git add them to the index. Use git commit or
- git merge --continue to seal the deal. The latter command
+ git add
them to the index. Use git commit
or
+ git merge --continue
to seal the deal. The latter command
checks whether there is a (interrupted) merge in progress
- before calling git commit.
+ before calling git commit
.
CONFIGURATION
Sets default options for merging into branch <name>. The syntax and
- supported options are the same as those of git merge, but option
+ supported options are the same as those of git merge
, but option
values containing whitespace characters are currently not supported.
GIT
diff --git a/git-merge.txt b/git-merge.txt index 3e9557a44..1ab69f61f 100644 --- a/git-merge.txt +++ b/git-merge.txt @@ -20,12 +20,12 @@ DESCRIPTION ----------- Incorporates changes from the named commits (since the time their histories diverged from the current branch) into the current -branch. This command is used by 'git pull' to incorporate changes +branch. This command is used by `git pull` to incorporate changes from another repository and can be used by hand to merge changes from one branch into another. Assume the following history exists and the current branch is -"`master`": +`master`: ------------ A---B---C topic @@ -33,7 +33,7 @@ Assume the following history exists and the current branch is D---E---F---G master ------------ -Then "`git merge topic`" will replay the changes made on the +Then `git merge topic` will replay the changes made on the `topic` branch since it diverged from `master` (i.e., `E`) until its current commit (`C`) on top of `master`, and record the result in a new commit along with the names of the two parent commits and @@ -46,21 +46,21 @@ a log message from the user describing the changes. Before the operation, D---E---F---G---H master ------------ -The second syntax ("`git merge --abort`") can only be run after the -merge has resulted in conflicts. 'git merge --abort' will abort the -merge process and try to reconstruct the pre-merge state. However, -if there were uncommitted changes when the merge started (and -especially if those changes were further modified after the merge -was started), 'git merge --abort' will in some cases be unable to -reconstruct the original (pre-merge) changes. Therefore: +A merge stops if there's a conflict that cannot be resolved +automatically or if `--no-commit` was provided when initiating the +merge. At that point you can run `git merge --abort` or `git merge +--continue`. -*Warning*: Running 'git merge' with non-trivial uncommitted changes is +`git merge --abort` will abort the merge process and try to reconstruct +the pre-merge state. However, if there were uncommitted changes when the +merge started (and especially if those changes were further modified +after the merge was started), `git merge --abort` will in some cases be +unable to reconstruct the original (pre-merge) changes. Therefore: + +*Warning*: Running `git merge` with non-trivial uncommitted changes is discouraged: while possible, it may leave you in a state that is hard to back out of in the case of a conflict. -The third syntax ("`git merge --continue`") can only be run after the -merge has resulted in conflicts. - OPTIONS ------- :git-merge: 1 @@ -74,8 +74,8 @@ include::merge-options.txt[] If `--log` is specified, a shortlog of the commits being merged will be appended to the specified message. + -The 'git fmt-merge-msg' command can be -used to give a good default for automated 'git merge' +The `git fmt-merge-msg` command can be +used to give a good default for automated `git merge` invocations. The automated message can include the branch description. --into-namegit-remote-helpers
-2024-01-02 +2024-01-08Keep authoritative canonical history correct with git pull
-2024-01-02 +2024-01-08Keep authoritative canonical history correct with git pull
diff --git a/howto/maintain-git.html b/howto/maintain-git.html index 74acaf1e0..01be75bb0 100644 --- a/howto/maintain-git.html +++ b/howto/maintain-git.html @@ -735,7 +735,7 @@How to maintain Git
-2024-01-02 +2024-01-08Preparing a "merge-fix"
diff --git a/howto/new-command.html b/howto/new-command.html index 75863a43b..64293890e 100644 --- a/howto/new-command.html +++ b/howto/new-command.html @@ -735,7 +735,7 @@How to integrate new subcommands
-2024-01-02 +2024-01-08Integrating a command
diff --git a/howto/rebase-from-internal-branch.html b/howto/rebase-from-internal-branch.html index 757769bbf..32a21ec2c 100644 --- a/howto/rebase-from-internal-branch.html +++ b/howto/rebase-from-internal-branch.html @@ -735,7 +735,7 @@How to rebase from an internal branch
-2024-01-02 +2024-01-08How to rebase from an internal branch
diff --git a/howto/rebuild-from-update-hook.html b/howto/rebuild-from-update-hook.html index 906102082..9fd511724 100644 --- a/howto/rebuild-from-update-hook.html +++ b/howto/rebuild-from-update-hook.html @@ -735,7 +735,7 @@How to rebuild from update hook
-2024-01-02 +2024-01-08How to rebuild from update hook
diff --git a/howto/recover-corrupted-blob-object.html b/howto/recover-corrupted-blob-object.html index e6efbc328..b4bbeb5dc 100644 --- a/howto/recover-corrupted-blob-object.html +++ b/howto/recover-corrupted-blob-object.html @@ -735,7 +735,7 @@How to recover a corrupted blob object
-2024-01-02 +2024-01-08How to recover a corrupted blob object
diff --git a/howto/recover-corrupted-object-harder.html b/howto/recover-corrupted-object-harder.html index 55f43dec1..db8fa8408 100644 --- a/howto/recover-corrupted-object-harder.html +++ b/howto/recover-corrupted-object-harder.html @@ -735,7 +735,7 @@How to recover an object from scratch
-2024-01-02 +2024-01-08The adventure continues…
diff --git a/howto/revert-a-faulty-merge.html b/howto/revert-a-faulty-merge.html index d6a67302c..572fdab7c 100644 --- a/howto/revert-a-faulty-merge.html +++ b/howto/revert-a-faulty-merge.html @@ -735,7 +735,7 @@How to revert a faulty merge
-2024-01-02 +2024-01-08How to revert a faulty merge
diff --git a/howto/revert-branch-rebase.html b/howto/revert-branch-rebase.html index a9f7ae79f..e947d5ffb 100644 --- a/howto/revert-branch-rebase.html +++ b/howto/revert-branch-rebase.html @@ -735,7 +735,7 @@How to revert an existing commit
-2024-01-02 +2024-01-08How to revert an existing commit
diff --git a/howto/separating-topic-branches.html b/howto/separating-topic-branches.html index f0a5f9453..6d8f42d64 100644 --- a/howto/separating-topic-branches.html +++ b/howto/separating-topic-branches.html @@ -735,7 +735,7 @@How to separate topic branches
-2024-01-02 +2024-01-08How to separate topic branches
diff --git a/howto/setup-git-server-over-http.html b/howto/setup-git-server-over-http.html index 573929870..e751d3126 100644 --- a/howto/setup-git-server-over-http.html +++ b/howto/setup-git-server-over-http.html @@ -735,7 +735,7 @@How to setup Git server over http
-2024-01-02 +2024-01-08Troubleshooting:
diff --git a/howto/update-hook-example.html b/howto/update-hook-example.html index 629caeb0a..23f116236 100644 --- a/howto/update-hook-example.html +++ b/howto/update-hook-example.html @@ -735,7 +735,7 @@How to use the update hook
-2024-01-02 +2024-01-08How to use the update hook
diff --git a/howto/use-git-daemon.html b/howto/use-git-daemon.html index 847eb10ce..6f39de962 100644 --- a/howto/use-git-daemon.html +++ b/howto/use-git-daemon.html @@ -735,7 +735,7 @@How to use git-daemon
-2024-01-02 +2024-01-08How to use git-daemon
diff --git a/howto/using-merge-subtree.html b/howto/using-merge-subtree.html index 7886b384e..e7e47be05 100644 --- a/howto/using-merge-subtree.html +++ b/howto/using-merge-subtree.html @@ -735,7 +735,7 @@How to use the subtree merge strategy
-2024-01-02 +2024-01-08Additional tips
diff --git a/howto/using-signed-tag-in-pull-request.html b/howto/using-signed-tag-in-pull-request.html index b7fc56593..8b1a0a581 100644 --- a/howto/using-signed-tag-in-pull-request.html +++ b/howto/using-signed-tag-in-pull-request.html @@ -735,7 +735,7 @@How to use a signed tag in pull requests
-2024-01-02 +2024-01-08Auditors
diff --git a/technical/api-error-handling.html b/technical/api-error-handling.html index 016d83185..b0600ece5 100644 --- a/technical/api-error-handling.html +++ b/technical/api-error-handling.html @@ -735,7 +735,7 @@Error reporting in git
-2024-01-02 +2024-01-08Git API Documents
-2024-01-02 +2024-01-08merge API
-2024-01-02 +2024-01-08parse-options API
-2024-01-02 +2024-01-08Simple-IPC API
-2024-01-02 +2024-01-08Trace2 API
-2024-01-02 +2024-01-08GIT bitmap v1 format
-2024-01-02 +2024-01-08Bundle URIs
-2024-01-02 +2024-01-08Git hash function transition
-2024-01-02 +2024-01-08Long-running process protocol
-2024-01-02 +2024-01-08Multi-Pack-Index (MIDX) Design Notes
-2024-01-02 +2024-01-08Concerning Git’s Packing Heuristics
-2024-01-02 +2024-01-08Parallel Checkout Design Notes
-2024-01-02 +2024-01-08Partial Clone Design Notes
-2024-01-02 +2024-01-08Use of index and Racy Git problem
-2024-01-02 +2024-01-08Scalar
-2024-01-02 +2024-01-08Git-send-pack internals
-2024-01-02 +2024-01-08Shallow commits
-2024-01-02 +2024-01-08Trivial merge rules
-2024-01-02 +2024-01-08Unit Testing
-2024-01-02 +2024-01-08Table of Contents
- Introduction
- 1. Repositories and Branches
- How to get a Git repository
- How to check out a different version of a project
- Understanding History: Commits
- 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
- 3. Developing with Git
- 4. Sharing development with others
- 5. Rewriting history and maintaining patch series
- 6. Advanced branch management
- 7. Git concepts
- 8. Submodules
- 9. Low-level Git operations
- 10. Hacking Git
- 11. Git Glossary
- A. Git Quick Reference
- B. Notes and todo list for this manual
Git is a fast distributed revision control system.
This manual is designed to be readable by someone with basic UNIX +
Table of Contents
- Introduction
- 1. Repositories and Branches
- How to get a Git repository
- How to check out a different version of a project
- Understanding History: Commits
- 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
- 3. Developing with Git
- 4. Sharing development with others
- 5. Rewriting history and maintaining patch series
- 6. Advanced branch management
- 7. Git concepts
- 8. Submodules
- 9. Low-level Git operations
- 10. Hacking Git
- 11. Git Glossary
- A. Git Quick Reference
- B. Notes and todo list for this manual
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 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