1 Remotes configuration API
2 =========================
4 The API in remote.h gives access to the configuration related to
5 remotes. It handles all three configuration mechanisms historically
6 and currently used by Git, and presents the information in a uniform
7 fashion. Note that the code also handles plain URLs without any
8 configuration, giving them just the default information.
15 The user's nickname for the remote
19 An array of all of the url_nr URLs configured for the remote
23 An array of all of the pushurl_nr push URLs configured for the remote
27 An array of refspecs configured for pushing, with
28 push_refspec being the literal strings, and push_refspec_nr
33 An array of refspecs configured for fetching, with
34 fetch_refspec being the literal strings, and fetch_refspec_nr
39 The setting for whether to fetch tags (as a separate rule from
40 the configured refspecs); -1 means never to fetch tags, 0
41 means to auto-follow tags based on the default heuristic, 1
42 means to always auto-follow tags, and 2 means to fetch all
45 `receivepack`, `uploadpack`::
47 The configured helper programs to run on the remote side, for
52 The proxy to use for curl (http, https, ftp, etc.) URLs.
54 `http_proxy_authmethod`::
56 The method used for authenticating against `http_proxy`.
58 struct remotes can be found by name with remote_get(), and iterated
59 through with for_each_remote(). remote_get(NULL) will return the
60 default remote, given the current branch and configuration.
65 A struct refspec holds the parsed interpretation of a refspec. If it
66 will force updates (starts with a '+'), force is true. If it is a
67 pattern (sides end with '*') pattern is true. src and dest are the
68 two sides (including '*' characters if present); if there is only one
69 side, it is src, and dst is NULL; if sides exist but are empty (i.e.,
70 the refspec either starts or ends with ':'), the corresponding side is
73 An array of strings can be parsed into an array of struct refspecs
74 using parse_fetch_refspec() or parse_push_refspec().
76 remote_find_tracking(), given a remote and a struct refspec with
77 either src or dst filled out, will fill out the other such that the
78 result is in the "fetch" specification for the remote (note that this
79 evaluates patterns and returns a single result).
84 Note that this may end up moving to branch.h
86 struct branch holds the configuration for a branch. It can be looked
87 up with branch_get(name) for "refs/heads/{name}", or with
88 branch_get(NULL) for HEAD.
94 The short name of the branch.
98 The full path for the branch ref.
102 The name of the remote listed in the configuration.
106 An array of the "merge" lines in the configuration.
110 An array of the struct refspecs used for the merge lines. That
111 is, merge[i]->dst is a local tracking ref which should be
112 merged into this branch by default.
116 The number of merge configurations
118 branch_has_merge_config() returns true if the given branch has merge
124 There is other stuff in remote.h that is related, in general, to the
125 process of interacting with remotes.