class
Agate::Remote
- Agate::Remote
- Reference
- Object
Overview
Represents a git remote.
Defined in:
agate/remote.crConstructors
-
.lookup(repo : Repository, name : String) : Remote
Looks up a remote by name.
Class Method Summary
-
.lookup?(repo : Repository, name : String) : Remote | Nil
Looks up a remote by name, returning nil if not found.
-
.valid_name?(name : String) : Bool
Returns true if the given name is valid for a remote.
Instance Method Summary
-
#check_connection(direction : Direction = Direction::Fetch, credentials : Credentials::Provider | Nil = nil) : Bool
Checks if a connection to the remote can be established.
-
#fetch(refspecs : Array(String) | Nil = nil, credentials : Credentials::Provider | Nil = nil, reflog_message : String | Nil = nil, &block : String, String | Nil, UInt32 -> Credentials::Credential | Nil) : Nil
Fetches from this remote.
-
#fetch(refspecs : Array(String) | Nil = nil, credentials : Credentials::Provider | Nil = nil, reflog_message : String | Nil = nil) : Nil
Fetches from this remote.
-
#fetch_refspecs : Array(String)
Returns the fetch refspecs.
-
#ls : Array(Tuple(OID, String))
Lists the remote references after connecting.
-
#name : String | Nil
Returns the remote name, or nil for anonymous remotes.
-
#push(refspecs : Array(String) | Nil = nil, credentials : Credentials::Provider | Nil = nil, &block : String, String | Nil, UInt32 -> Credentials::Credential | Nil) : Nil
Pushes to this remote.
-
#push(refspecs : Array(String) | Nil = nil, credentials : Credentials::Provider | Nil = nil) : Nil
Pushes to this remote.
-
#push_refspecs : Array(String)
Returns the push refspecs.
-
#push_url : String | Nil
Returns the push URL, or nil if not set (uses fetch URL).
-
#url : String
Returns the fetch URL.
Constructor Detail
Looks up a remote by name. Raises on failure.
Class Method Detail
Looks up a remote by name, returning nil if not found.
Instance Method Detail
Checks if a connection to the remote can be established.
Fetches from this remote. Accepts an optional credential provider or a block for dynamic credential resolution.
Fetches from this remote. Accepts an optional credential provider or a block for dynamic credential resolution.
Lists the remote references after connecting. The remote must
already be connected (via #fetch, #push, or #check_connection).
Returns an array of {oid, name} pairs.
remote.check_connection
remote.ls.each do |oid, name|
puts "#{name} -> #{oid}"
end
Pushes to this remote. Accepts an optional credential provider or a block for dynamic credential resolution.
Pushes to this remote. Accepts an optional credential provider or a block for dynamic credential resolution.