Skip to content

Commit a609cd3

Browse files
authored
Merge pull request #18 from xnivaxhzne/feature-git-checkout-pull-master
Add command for gcm && gpm in a single command
2 parents 223ed14 + 09d2682 commit a609cd3

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ npm i -g @xniva/git-shortcuts
3535
| `grb` | `git reset --${hardOrSoft} origin/$(git rev-parse --abbrev-ref HEAD)` | Reset the current branch to its remote equivalent |
3636
| `gphf` | `git push origin HEAD --force` | Force push the current branch |
3737
| `gc` | `git commit -m ${commitMessage}` | Commit with the give message |
38+
| `gcpm` | `gcm && gpm` | Checkout master and pull |
3839

3940
### Master branch name is configurable:
4041

bin/git_checkout_pull_master.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /usr/bin/env node
2+
import main from "../lib/git_checkout_pull_master/index.js";
3+
4+
main();

lib/git_checkout_pull_master/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import runCommand from "../utils/run_command.js";
2+
3+
const main = () => {
4+
runCommand(`gcm`);
5+
runCommand(`gpm`);
6+
};
7+
8+
export default main;

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"gma": "bin/git_merge_abort.js",
2222
"grb": "bin/git_reset_current_branch.js",
2323
"gphf": "bin/git_push_head_force.js",
24-
"gc": "bin/git_commit_message.js"
24+
"gc": "bin/git_commit_message.js",
25+
"gcpm": "bin/git_checkout_pull_master.js"
2526
},
2627
"author": "Kavinkumar R",
2728
"license": "MIT",

0 commit comments

Comments
 (0)