1.7.1 • Published 1 year ago

@xniva/git-shortcuts v1.7.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Git Shortcuts

@xniva/git-shortcuts is a cli tool which provides shortcuts for the commanly used git commands.

Example:

use gl for the git log command to view the recent commit

Installation:

Install it globally using the command

npm i -g @xniva/git-shortcuts

List of available commands:

shortcut commandactual git commandaction
glgit logShow the list of commits for the current branch
gsgit statusShow the status of the changes
gbgit branch --show-currentShow the name of the current branch
gcmgit checkout masterSwicth to the master branch
gfgit fetchFetch from the remote
gpmgit pull origin masterPull the changes from the remote master branch
gmmgit merge origin masterMerge the changes from the remote master to the current branch
gphgit push origin HEADPush the current branch and its changes to remote and open the new PR url in browser
gsrgit reset --soft HEAD~1Remove the last commit and preserve the changes
ghrgit reset --hard HEAD~1Completely delete the changes of the last commit
glpgit show-branch --no-name HEADPrint the last commit message
glcgit show-branch --no-name HEADCopy and Print the last commit message
gsfgcm && gpm && git merge --no-commit --no-ff origin/${featureBranch}List the changes of a feature branch w.r.t master - for review
gmagit merge --abortAbort the merge
grbgit reset --${hardOrSoft} origin/$(git rev-parse --abbrev-ref HEAD)Reset the current branch to its remote equivalent
gphfgit push origin HEAD --forceForce push the current branch
gcgit commit -m ${commitMessage}Commit the staged files with the give message
gcpmgcm && gpmCheckout master and pull
gcagit commit -am ${commitMessage}Commit all the files with the give message

Master branch name is configurable:

Add a .env file in the directory where you are using the shortcuts and add the following line to set the master branch name

MASTER_BRANCH_NAME=main // or any other branch name
1.7.1

1 year ago

1.7.0

1 year ago

1.6.0

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.0

2 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago