用法:
LibGit2.git_url(; kwargs...) -> String根据提供的 URL 组件创建一个字符串。如果未提供 scheme 关键字,则生成的 URL 将使用替代 scp-like syntax 。
关键词
- scheme::AbstractString="":标识要使用的协议的 URL 方案。对于 HTTP 使用 "http",SSH 使用 "ssh" 等。当未提供- scheme时,输出格式将为 "ssh",但使用 scp-like 语法。
- username::AbstractString="":在输出中使用的用户名(如果提供)。
- password::AbstractString="":在输出中使用的密码(如果提供)。
- host::AbstractString="":要在输出中使用的主机名。需要指定主机名。
- port::Union{AbstractString,Integer}="":输出中使用的端口号(如果提供)。使用scp-like 语法时无法指定。
- path::AbstractString="":在输出中使用的路径(如果提供)。
警告
避免在 URL 中使用密码。与凭证对象不同,Julia 在使用后无法安全地将敏感数据归零或销毁,密码可能会保留在内存中;可能会被未初始化的内存暴露。
例子
julia> LibGit2.git_url(username="git", host="github.com", path="JuliaLang/julia.git")
"git@github.com:JuliaLang/julia.git"
julia> LibGit2.git_url(scheme="https", host="github.com", path="/JuliaLang/julia.git")
"https://github.com/JuliaLang/julia.git"
julia> LibGit2.git_url(scheme="ssh", username="git", host="github.com", port=2222, path="JuliaLang/julia.git")
"ssh://git@github.com:2222/JuliaLang/julia.git"相关用法
- Julia LibGit2.count用法及代码示例
- Julia LibGit2.authors用法及代码示例
- Julia LibGit2.clone用法及代码示例
- Julia LibGit2.GitRemoteAnon用法及代码示例
- Julia LibGit2.addblob!用法及代码示例
- Julia LibGit2.isdiff用法及代码示例
- Julia LibGit2.is_ancestor_of用法及代码示例
- Julia LibGit2.GitObject方法用法及代码示例
- Julia LibGit2.fetchheads用法及代码示例
- Julia LibGit2.name用法及代码示例
- Julia LibGit2.reset!用法及代码示例
- Julia LibGit2.@githash_str用法及代码示例
- Julia LibGit2.push_refspecs用法及代码示例
- Julia LibGit2.add_fetch!用法及代码示例
- Julia LibGit2.ProxyOptions用法及代码示例
- Julia LibGit2.set_remote_url用法及代码示例
- Julia LibGit2.revcount用法及代码示例
- Julia LibGit2.fetch_refspecs用法及代码示例
- Julia LibGit2.diff_files用法及代码示例
- Julia LibGit2.branch!用法及代码示例
- Julia LibGit2.GitRemote用法及代码示例
- Julia LibGit2.isdirty用法及代码示例
- Julia LibGit2.url用法及代码示例
- Julia LibGit2.split_cfg_entry用法及代码示例
- Julia LibGit2.checkout!用法及代码示例
注:本文由纯净天空筛选整理自julialang.org 大神的英文原创作品 LibGit2.git_url — Function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
