MCPcopy
hub / github.com/opactorai/Claudable / pushToRemote

Function pushToRemote

lib/services/git.ts:163–173  ·  view source on GitHub ↗
(repoPath: string, remoteName = 'origin', branch = 'main')

Source from the content-addressed store, hash-verified

161}
162
163export function pushToRemote(repoPath: string, remoteName = 'origin', branch = 'main') {
164 try {
165 runGit(['push', '-u', remoteName, branch], repoPath);
166 } catch (error) {
167 if (error instanceof GitError) {
168 runGit(['push', '-u', '--force', remoteName, branch], repoPath);
169 } else {
170 throw error;
171 }
172 }
173}
174
175export function ensureGitRepository(repoPath: string) {
176 if (!fs.existsSync(repoPath)) {

Callers 1

pushProjectToGitHubFunction · 0.90

Calls 1

runGitFunction · 0.85

Tested by

no test coverage detected