<flag> <summary> <from> -> <to> (<reason>)+
From 6d559fc736bece9bac0d731b496639cbfe9ef757 Mon Sep 17 00:00:00 2001
From: Junio C Hamano Runs git-fetch with the given parameters, and calls git-merge
-to merge the retrieved head(s) into the current branch. Note that you can use . (current directory) as the
<repository> to pull from the local repository — this is useful
when merging local branches into the current branch.
+ Instead of a merge, perform a rebase after fetching. If
+ there is a remote ref for the upstream branch, and this branch
+ was rebased since last fetched, the rebase uses that information
+ to avoid rebasing non-local changes. To make this the default
+ for branch <name>, set configuration branch.<name>.rebase
+ to true.
+ NOTE: This is a potentially _dangerous_ mode of operation.
+It rewrites history, which does not bode well when you
+published that history already. Do not use this option
+unless you have read git-rebase(1) carefully.
+ Override earlier --rebase.
+
- Instead of a merge, perform a rebase after fetching. If
- there is a remote ref for the upstream branch, and this branch
- was rebased since last fetched, the rebase uses that information
- to avoid rebasing non-local changes.
- NOTE: This is a potentially _dangerous_ mode of operation.
-It rewrites history, which does not bode well when you
-published that history already. Do not use this option
-unless you have read git-rebase(1) carefully.
- Override earlier --rebase.
-DESCRIPTION
DEFAULT BEHAVIOUR
@@ -970,7 +973,7 @@ Junio C Hamano and the git-list <git@vger.kernel.org>.
The API in remote.h gives access to the configuration related to +remotes. It handles all three configuration mechanisms historically +and currently used by git, and presents the information in a uniform +fashion. Note that the code also handles plain URLs without any +configuration, giving them just the default information.
++ The user's nickname for the remote +
++ An array of all of the url_nr URLs configured for the remote +
++ An array of refspecs configured for pushing, with + push_refspec being the literal strings, and push_refspec_nr + being the quantity. +
++ An array of refspecs configured for fetching, with + fetch_refspec being the literal strings, and fetch_refspec_nr + being the quantity. +
++ The setting for whether to fetch tags (as a separate rule from + the configured refspecs); -1 means never to fetch tags, 0 + means to auto-follow tags based on the default heuristic, 1 + means to always auto-follow tags, and 2 means to fetch all + tags. +
++ The configured helper programs to run on the remote side, for + git-native protocols. +
++ The proxy to use for curl (http, https, ftp, etc.) URLs. +
+struct remotes can be found by name with remote_get(), and iterated +through with for_each_remote(). remote_get(NULL) will return the +default remote, given the current branch and configuration.
+A struct refspec holds the parsed interpretation of a refspec. If it +will force updates (starts with a +), force is true. If it is a +pattern (sides end with *) pattern is true. src and dest are the two +sides (if a pattern, only the part outside of the wildcards); if there +is only one side, it is src, and dst is NULL; if sides exist but are +empty (i.e., the refspec either starts or ends with :), the +corresponding side is "".
+This parsing can be done to an array of strings to give an array of +struct refpsecs with parse_ref_spec().
+remote_find_tracking(), given a remote and a struct refspec with +either src or dst filled out, will fill out the other such that the +result is in the "fetch" specification for the remote (note that this +evaluates patterns and returns a single result).
+Note that this may end up moving to branch.h
+struct branch holds the configuration for a branch. It can be looked +branch_get(NULL) for HEAD.
+It contains:
++ The short name of the branch. +
++ The full path for the branch ref. +
++ The name of the remote listed in the configuration. +
++ The struct remote for that remote. +
++ An array of the "merge" lines in the configuration. +
++ An array of the struct refspecs used for the merge lines. That + is, merge[i]->dst is a local tracking ref which should be + merged into this branch by default. +
++ The number of merge configurations +
+branch_has_merge_config() returns true if the given branch has merge +configuration given.
+There is other stuff in remote.h that is related, in general, to the +process of interacting with remotes.
+(Daniel Barkalow)
+
diff --git a/git-pull.txt b/git-pull.txt
index 179bdfc69..737894390 100644
--- a/git-pull.txt
+++ b/git-pull.txt
@@ -15,6 +15,7 @@ DESCRIPTION
-----------
Runs `git-fetch` with the given parameters, and calls `git-merge`
to merge the retrieved head(s) into the current branch.
+With `--rebase`, calls `git-rebase` instead of `git-merge`.
Note that you can use `.` (current directory) as the
Note: If no explicit refspec is found, (that is neither on the command line nor in any Push line of the -corresponding remotes file---see below), then all the -heads that exist both on the local side and on the remote -side are updated.
+corresponding remotes file---see below), then "matching" heads are +pushed: for every head that exists on the local side, the remote side is +updated if a head of the same name already exists on the remote side.
tag <tag> means the same as refs/tags/<tag>:refs/tags/<tag>.
A parameter <ref> without a colon pushes the <ref> from the source repository to the destination repository under the same name.
@@ -572,6 +572,81 @@ corresponding file in the $GIT_DIR/remotes/ directory.
Pull: refs/heads/<head>:<remote> +
+
The output of "git push" depends on the transport method used; this +section describes the output when pushing over the git protocol (either +locally or via ssh).
+The status of the push is output in tabular form, with each line +representing the status of a single ref. Each line is of the form:
+<flag> <summary> <from> -> <to> (<reason>)+
+ A single character indicating the status of the ref. This is + blank for a successfully pushed ref, ! for a ref that was + rejected or failed to push, and = for a ref that was up to + date and did not need pushing (note that the status of up to + date refs is shown only when git push is running verbosely). +
++ For a successfully pushed ref, the summary shows the old and new + values of the ref in a form suitable for using as an argument to + git log (this is <old>..<new> in most cases, and + <old>…<new> for forced non-fast forward updates). For a + failed update, more details are given for the failure. + The string rejected indicates that git did not try to send the + ref at all (typically because it is not a fast forward). The + string remote rejected indicates that the remote end refused + the update; this rejection is typically caused by a hook on the + remote side. The string remote failure indicates that the + remote end did not report the successful update of the ref + (perhaps because of a temporary error on the remote side, a + break in the network connection, or other transient error). +
++ The name of the local ref being pushed, minus its + refs/<type>/ prefix. In the case of deletion, the + name of the local ref is omitted. +
++ The name of the remote ref being updated, minus its + refs/<type>/ prefix. +
++ A human-readable explanation. In the case of successfully pushed + refs, no explanation is needed. For a failed ref, the reason for + failure is described. +
+
diff --git a/git-push.txt b/git-push.txt
index 5f2494495..3128170bc 100644
--- a/git-push.txt
+++ b/git-push.txt
@@ -47,9 +47,9 @@ even if it does not result in a fast forward update.
+
Note: If no explicit refspec is found, (that is neither
on the command line nor in any Push line of the
-corresponding remotes file---see below), then all the
-heads that exist both on the local side and on the remote
-side are updated.
+corresponding remotes file---see below), then "matching" heads are
+pushed: for every head that exists on the local side, the remote side is
+updated if a head of the same name already exists on the remote side.
+
`tag
+
@@ -372,7 +377,7 @@ documents them.
diff --git a/technical/api-index.txt b/technical/api-index.txt index bc9c190a9..6c272fc08 100644 --- a/technical/api-index.txt +++ b/technical/api-index.txt @@ -21,6 +21,7 @@ documents them. * link:api-parse-options.html[parse-options API] * link:api-path-list.html[path-list API] * link:api-quote.html[quote API] +* link:api-remote.html[Remotes configuration API] * link:api-revision-walking.html[revision walking API] * link:api-run-command.html[run-command API] * link:api-setup.html[setup API] diff --git a/technical/api-remote.html b/technical/api-remote.html new file mode 100644 index 000000000..a796310be --- /dev/null +++ b/technical/api-remote.html @@ -0,0 +1,443 @@ + + +
+ + + +
+ +
+