Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/Documentation/git-url-parse.adoc # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / Documentation / git-url-parse.adoc` 80 lines ยท 1913 bytes Raw Blame History 1 git-url-parse(1) 2 ================ 3 4 NAME 5 ---- 6 git-url-parse - Parse and extract git URL components 7 8 SYNOPSIS 9 -------- 10 [synopsis] 11 git url-parse [-c ] [--] ... 12 13 DESCRIPTION 14 ----------- 15 16 Git supports many ways to specify URLs, some of them non-standard. 17 For example, git supports the scp style [user@]host:[path] format. 18 This command eases interoperability with git URLs by enabling the 19 parsing and extraction of the components of all git URLs. 20 21 Any syntactically valid URL is parsed, even if the scheme is not one 22 git supports for fetching or pushing. 23 24 OPTIONS 25 ------- 26 27 `-c `:: 28 `--component `:: 29 Extract the __ component from the given Git URLs. 30 __ can be one of: 31 `scheme`, `user`, `password`, `host`, `port`, `path`. 32 33 OUTPUT 34 ------ 35 36 When `--component` is given, the requested component of each URL 37 is printed on its own line, in the order the URLs were given. If 38 the URL has no such component (for example, a port in a URL that 39 does not specify one), an empty line is printed in its place. 40 41 When `--component` is not given, no output is produced. The exit 42 status is zero if every URL parses successfully and non-zero 43 otherwise, allowing the command to be used purely as a validator. 44 45 EXAMPLES 46 -------- 47 48 * Print the host name: 49 + 50 ------------ 51 $ git url-parse --component host https://example.com/user/repo 52 example.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 72 SEE ALSO 73 -------- 74 linkgit:git-clone[1], 75 linkgit:git-fetch[1], 76 linkgit:git-config[1] 77 78 GIT 79 --- 80 Part of the linkgit:git[1] suite