Skip to content

Instantly share code, notes, and snippets.

@wess
Created October 30, 2020 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wess/f9e8a9a48f0fecee5019def933d95df1 to your computer and use it in GitHub Desktop.
Save wess/f9e8a9a48f0fecee5019def933d95df1 to your computer and use it in GitHub Desktop.
this.openRepo = await Repository.init(this.target, 0)
const origin = `git@github.com:wess/spose.git`
const index = await this.openRepo.refreshIndex()
const oid = await index.addAll()
await index.write()
const toid = await index.writeTree()
const commit = await this.openRepo.createCommit("HEAD", this.signature, this.signature, "initial commit", toid, [])
const remote = await Remote.create(this.openRepo, "origin", origin)
// Cred.sshKeyNew(
// username,
// env.keys.public,
// env.keys.private,
// ''
// )
return remote.push(
["refs/heads/master:refs/heads/master"],
{
callbacks: {
certificateCheck: () => 1,
credentials: (_url, username) => Cred.sshKeyFromAgent(username)
}
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment