public class TransportSftp extends SshTransport implements WalkTransport
The SFTP transport does not require any specialized Git support on the remote (server side) repository. Object files are retrieved directly through secure shell's FTP protocol, making it possible to copy objects from a remote repository that is available over SSH, but whose remote host does not have Git installed.
Unlike the HTTP variant (see
TransportHttp
) we rely upon being able to
list files in directories, as the SFTP protocol supports this function. By
listing files through SFTP we can avoid needing to have current
objects/info/packs
or info/refs
files on the remote
repository and access the data directly, much as Git itself would.
Concurrent pushing over this transport is not supported. Multiple concurrent push operations may cause confusion in the repository state.
WalkFetchConnection
Transport.Operation
DEFAULT_FETCH_THIN, DEFAULT_PUSH_THIN, local, REFSPEC_PUSH_ALL, REFSPEC_TAGS, uri
Modifier and Type | Method and Description |
---|---|
FetchConnection |
openFetch()
Begins a new connection for fetching from the remote repository.
|
PushConnection |
openPush()
Begins a new connection for pushing into the remote repository.
|
close, getSession, getSshSessionFactory, setSshSessionFactory
applyConfig, fetch, findRemoteRefUpdatesFor, findRemoteRefUpdatesFor, findRemoteRefUpdatesFor, findRemoteRefUpdatesFor, getCredentialsProvider, getObjectChecker, getOptionReceivePack, getOptionUploadPack, getPackConfig, getPushOptions, getTagOpt, getTimeout, getTransportProtocols, getURI, isCheckFetchedObjects, isDryRun, isFetchThin, isPushAtomic, isPushThin, isRemoveDeletedRefs, open, open, open, open, open, open, open, openAll, openAll, openAll, openAll, push, push, register, setCheckFetchedObjects, setCredentialsProvider, setDryRun, setFetchThin, setObjectChecker, setOptionReceivePack, setOptionUploadPack, setPackConfig, setPushAtomic, setPushOptions, setPushThin, setRemoveDeletedRefs, setTagOpt, setTimeout, unregister
public FetchConnection openFetch() throws TransportException
If the transport has no local repository, the fetch connection can only be used for reading remote refs.
openFetch
in class Transport
TransportException
- the remote connection could not be established.public PushConnection openPush() throws TransportException
openPush
in class Transport
TransportException
- the remote connection could not be establishedCopyright © 2017 Eclipse JGit Project. All rights reserved.