Working Copy
Working Copy is a powerful Git client for iOS that clones, edits, commits, pushes and more. Protocol Launcher allows you to generate deep links to perform Git operations in Working Copy.
Usage
There are two ways to use this library:
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
- Full Import from the root package is convenient but includes all app modules.
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
Select Installation Method
Simple Commands
Open
Open Working Copy app.
import { open } from 'protocol-launcher/working-copy'
const url = open()Clone
Ask Working Copy to open the clone dialog with a specific URL.
import { clone } from 'protocol-launcher/working-copy'
const url = clone({
remote: 'https://github.com/zhensherlock/watermark-js-plus.git',
})Show
Show a remote repository inside Working Copy, cloning as needed.
import { show } from 'protocol-launcher/working-copy'
const url = show({
remote: 'https://github.com/zhensherlock/watermark-js-plus.git',
})Open Screen
Open Working Copy at a specific screen.
import { openScreen } from 'protocol-launcher/working-copy'
const url = openScreen({
repo: 'my project',
path: 'README.md',
mode: 'content',
})Import Log
Import and show log files in Working Copy.
import { importLog } from 'protocol-launcher/working-copy'
const url = importLog({
lines: 'first line\nsecond line',
})X-Callback-URL Commands
Checkout
Checkout (switch) branch in Working Copy.
import { checkout } from 'protocol-launcher/working-copy'
const url = checkout({
key: '123ABC',
repo: 'my repo',
branch: 'develop',
})Commit
Commit changes in Working Copy.
import { commit } from 'protocol-launcher/working-copy'
const url = commit({
key: '123ABC',
repo: 'my repo',
path: '',
limit: 999,
message: 'fix',
})Push
Push commits to remote repository.
import { push } from 'protocol-launcher/working-copy'
const url = push({
key: '123ABC',
repo: 'my repo',
})Pull
Pull (fetch and merge) from remote repository.
import { pull } from 'protocol-launcher/working-copy'
const url = pull({
key: '123ABC',
repo: 'my repo',
})Fetch
Fetch from remote repository.
import { fetch } from 'protocol-launcher/working-copy'
const url = fetch({
key: '123ABC',
repo: 'my repo',
})Status
List file status in Working Copy.
import { status } from 'protocol-launcher/working-copy'
const url = status({
key: '123ABC',
repo: 'my repo',
unchanged: true,
})Log
Get commit log from Working Copy.
import { log } from 'protocol-launcher/working-copy'
const url = log({
key: '123ABC',
repo: 'my repo',
})Branches
List all local and remote branches in a repository.
import { branches } from 'protocol-launcher/working-copy'
const url = branches({
key: '123ABC',
repo: 'my repo',
})Merge
Merge branches in Working Copy.
import { merge } from 'protocol-launcher/working-copy'
const url = merge({
key: '123ABC',
repo: 'my repo',
branch: 'develop',
})Delete Branch
Delete a branch in Working Copy.
import { deleteBranch } from 'protocol-launcher/working-copy'
const url = deleteBranch({
key: '123ABC',
repo: 'my repo',
branch: 'develop',
})Init
Initialize a new empty repository.
import { init } from 'protocol-launcher/working-copy'
const url = init({
key: '123ABC',
name: 'new repository',
})Repos
List all repositories in Working Copy.
import { repos } from 'protocol-launcher/working-copy'
const url = repos({
key: '123ABC',
})Move
Move or rename files within a repository.
import { move } from 'protocol-launcher/working-copy'
const url = move({
key: '123ABC',
repo: 'my repo',
source: 'from.txt',
destination: 'to.txt',
})Read
Read contents of text files from Working Copy.
import { read } from 'protocol-launcher/working-copy'
const url = read({
key: '123ABC',
xSuccess: 'app://x-callback-url/read?text=',
repo: 'my repo',
path: 'README.md',
})Write
Write to existing or new files in Working Copy.
import { write } from 'protocol-launcher/working-copy'
const url = write({
key: '123ABC',
repo: 'my repo',
path: 'README.md',
text: 'hello there',
})Zip
Archive multiple files as a base64-coded zip.
import { zip } from 'protocol-launcher/working-copy'
const url = zip({
key: '123ABC',
xSuccess: 'my-app://x-callback-url/read?path=/',
repo: 'my repo',
})SSH Command
Run secure shell command on remote server.
import { sshCommand } from 'protocol-launcher/working-copy'
const url = sshCommand({
key: '123ABC',
server: 'remote.server.net',
cmd: 'run tests',
})WebDAV
Start or stop the internal WebDAV server.
import { webdav } from 'protocol-launcher/working-copy'
const url = webdav({
key: '123ABC',
cmd: 'start',
})Chain
Chain multiple x-callback-url commands together.
import { chain } from 'protocol-launcher/working-copy'
const url = chain({
key: '123ABC',
repo: 'my repo',
commands: [
{ command: 'commit', params: { message: 'fix' } },
{ command: 'push' },
],
})