Overview
Implement remote operations to enable ts-git to interact with remote repositories, matching isomorphic-git feature parity.
Commands to Implement
Acceptance Criteria (AC)
- AC1: Clone Functionality - Can clone a public repository from GitHub/Bitbucket via HTTPS
- AC2: Fetch Functionality - Can fetch refs and objects from a remote without merging
- AC3: Push Functionality - Can push local commits to a remote (with auth support for HTTPS)
- AC4: Remote Management - Can add, list, and delete remote configurations
- AC5: Pull Integration - Pull correctly fetches and merges/fast-forwards changes
- AC6: Type Safety - All functions have strict TypeScript types for parameters and return values
Definition of Done (DoD)
Interop Test Method
Create interoperability tests that compare ts-git output with canonical git CLI:
// Test clone
await tsGit.clone({ fs, http, dir: '/tmp/test-clone', url: 'https://github.com/octocat/Hello-World.git', depth: 1 });
const tsGitLog = await tsGit.log({ fs, dir: '/tmp/test-clone', depth: 1 });
// Compare with canonical git
execSync('git clone --depth 1 https://github.com/octocat/Hello-World.git /tmp/ref-clone');
const refLog = execSync('git -C /tmp/ref-clone log --oneline -1').toString();
// Assertions: tsGitLog[0].oid should match ref commit hash
Validation Strategy:
- Clone same repo with ts-git and canonical git
- Compare commit hashes, tree structure, and file contents
- Push to test remote and verify with canonical git
- Test error cases: auth failures, 404s, network errors
Priority
High - Core functionality for distributed version control
Dependencies
- Requires HTTP client abstraction (HttpClient interface)
- May require authentication token support
Overview
Implement remote operations to enable ts-git to interact with remote repositories, matching isomorphic-git feature parity.
Commands to Implement
clone- Clone a repository from a remote URLfetch- Fetch commits from a remote repositorypull- Fetch and merge commits from a remotepush- Push commits to a remote repositoryaddRemote- Add a new remote repositorydeleteRemote- Remove a remote repositorygetRemoteInfo- Get information about a remotelistRemotes- List all configured remotesAcceptance Criteria (AC)
Definition of Done (DoD)
Interop Test Method
Create interoperability tests that compare ts-git output with canonical git CLI:
Validation Strategy:
Priority
High - Core functionality for distributed version control
Dependencies