Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions scripts/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1187,11 +1187,16 @@ async function main() {
const name = arg1;
if (!name) die('branch name required — e.g. gg b feature/login (or gitgen branch feature/login)');
banner(`create branch ${name}`);
const message = await resolveMessage(messageFlag, "feat: new branch");
const dirty = await hasChanges();
await runSteps(async () => {
Comment thread
greptile-apps[bot] marked this conversation as resolved.
await git(["checkout", "-b", name]);
await git(["add", "."]);
await git(["commit", "-m", message]);
if (dirty) {
const message = await resolveMessage(messageFlag, "feat: new branch");
await git(["add", "."]);
await git(["commit", "-m", message]);
} else {
log(` ${c.dim("nothing to commit — pushing branch only")}`);
}
await git(["push", "-u", "origin", name], { progress: true });
});
return;
Expand Down
Loading