interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / Documentation / git-url-parse.adoc

80 lines · 1913 bytes Raw Blame History
1git-url-parse(1)
2================
3
4NAME
5----
6git-url-parse - Parse and extract git URL components
7
8SYNOPSIS
9--------
10[synopsis]
11git url-parse [-c <component>] [--] <url>...
12
13DESCRIPTION
14-----------
15
16Git supports many ways to specify URLs, some of them non-standard.
17For example, git supports the scp style [user@]host:[path] format.
18This command eases interoperability with git URLs by enabling the
19parsing and extraction of the components of all git URLs.
20
21Any syntactically valid URL is parsed, even if the scheme is not one
22git supports for fetching or pushing.
23
24OPTIONS
25-------
26
27`-c <component>`::
28`--component <component>`::
29 Extract the _<component>_ component from the given Git URLs.
30 _<component>_ can be one of:
31 `scheme`, `user`, `password`, `host`, `port`, `path`.
32
33OUTPUT
34------
35
36When `--component` is given, the requested component of each URL
37is printed on its own line, in the order the URLs were given. If
38the URL has no such component (for example, a port in a URL that
39does not specify one), an empty line is printed in its place.
40
41When `--component` is not given, no output is produced. The exit
42status is zero if every URL parses successfully and non-zero
43otherwise, allowing the command to be used purely as a validator.
44
45EXAMPLES
46--------
47
48* Print the host name:
49+
50------------
51$ git url-parse --component host https://example.com/user/repo
52example.com
53------------
54
55* Print the path:
56+
57------------
58$ git url-parse --component path https://example.com/user/repo
59/user/repo
60$ git url-parse --component path example.com:~user/repo
61~user/repo
62$ git url-parse --component path example.com:user/repo
63/user/repo
64------------
65
66* Validate URLs without outputting anything:
67+
68------------
69$ git url-parse https://example.com/user/repo example.com:~user/repo
70------------
71
72SEE ALSO
73--------
74linkgit:git-clone[1],
75linkgit:git-fetch[1],
76linkgit:git-config[1]
77
78GIT
79---
80Part of the linkgit:git[1] suite