Skip to content

Commit 96b98d7

Browse files
author
StéphaneD
committed
feat(force): re create force
1 parent 0e8e45d commit 96b98d7

File tree

5 files changed

+3355
-2149
lines changed

5 files changed

+3355
-2149
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ shortcut for
7171
git add . && git commit --amend --no-edit
7272
```
7373

74+
## rePrepare
75+
shortcut for
76+
git add . && git commit --amend --no-edit
77+
+ rebase on main
78+
+ push
79+
7480
## force
7581
rebase on develop or branch + push force
7682

index.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ const argv = require('yargs')
1313
.alias('t', 'test')
1414
.alias('l', 'last')
1515
.alias('g', 'groupBy')
16-
.alias('bu','bump')
17-
.alias('b','branch')
16+
.alias('bu', 'bump')
17+
.alias('b', 'branch')
18+
.alias('re', 'rePrepare')
1819
.argv
1920

2021
const { prettyPrint, write } = require('./src/commit-prettier/commit-prettier');
@@ -44,7 +45,7 @@ if (argv.checkCommit) {
4445
}
4546

4647
}
47-
if(argv.bump){
48+
if (argv.bump) {
4849
console.log(argv.bump);
4950
}
5051
if (argv.prettyPrint) {
@@ -55,7 +56,7 @@ if (argv.prettyPrint) {
5556

5657
const tags = shortCut.getTagsOrderedByDate().split('\n').reverse();
5758

58-
const numOftag=parseInt(argv.tag);
59+
const numOftag = parseInt(argv.tag);
5960

6061
const getFromTag = (tagNumber) => tags[+tagNumber];
6162

@@ -84,12 +85,16 @@ if (argv.messageComposer) {
8485
}
8586
}
8687

87-
if(argv.force){
88-
const branch=argv.branch || 'develop';
89-
shortCut.ex(`git add . && git commit --amend --no-edit && git fetch && git pull origin ${branch} --rebase && git push origin HEAD --force`);
88+
if (argv.force) {
89+
const branch = argv.branch || 'develop';
90+
shortCut.ex('git add .', true)
91+
shortCut.ex('git commit --amend --no-edit', true);
92+
shortCut.ex('git fetch ', true);
93+
shortCut.ex(`git pull origin ${branch} --rebase`, true);
94+
shortCut.ex('git push origin HEAD --force', true);
9095
}
9196

92-
if(argv.cane){
93-
shortCut.ex('git add .')
94-
shortCut.ex('git commit --amend --no-edit')
95-
}
97+
if (argv.cane) {
98+
shortCut.ex('git add .', true)
99+
shortCut.ex('git commit --amend --no-edit', true)
100+
}

0 commit comments

Comments
 (0)