Git operations
push
CLI
Workflow Engine
Codemod Studio
Codemod Registry
Core Concepts
- Building codemods
- Sharing codemods
Quick Links
Other Resources
Git operations
push
git.push(options)
Pushes commits to remote.
push after commit
import { git } from '@codemod.com/workflow'
// clone
const repository = await git.clone('git@github.com:codemod-com/codemod.git')
// make changes
await repository
.files()
.jsFam()
.astGrep('console.log($$$A)')
.replace('console.error($$$A)')
// commit and push
await repository
.commit('Changed console.log to console.error')
.push({ force: true })
Parameters
interface PushOptions {
/**
* Enables force push
* @default false
*/
force?: boolean
}
On this page