Skip to content

Instantly share code, notes, and snippets.

@qa1
Created February 26, 2020 07:31
Show Gist options
  • Save qa1/823475d8ef9c72769600b4fa5215a970 to your computer and use it in GitHub Desktop.
Save qa1/823475d8ef9c72769600b4fa5215a970 to your computer and use it in GitHub Desktop.
var exec = require('child_process').exec;
var targetBranch = process.argv[2] || "develop"
var title = process.argv[3] || "initial task"
var description = process.argv[4] || "initial task"
exec("git push origin HEAD \
-o merge_request.create \
-o merge_request.remove_source_branch \
-o merge_request.title=" + title + " \
-o merge_request.description=" + description + " \
-o merge_request.target=" + targetBranch,
(error, stdout, stderr) => {
stdout && console.log(`[stdout]\n${stdout}`);
stderr && console.log(`[stderr]\n${stderr}`);
if (error !== null) {
console.log(`exec error: ${error}`);
}
}
);
// node merge my-target-branch title description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment