Skip to content

DovahBot/git-Shortcut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

git-Shortcut

Custom git command to save/execute shortcuts on a per repo basis.

Table of Contents

  1. Install Instructions
  2. Usage
    1. Help
    2. Create Shortcuts
    3. Run Shortcuts
    4. Edit/Delete/List
  3. Contributing
  4. License

Install Instructions

To ensure this script functions for each new bash shell:

  1. Save git-shortcut to (for example) /your-directory/git-custom-commands
  2. cd ~/
  3. touch .bash_profile
  4. Edit .bash_profile and add "export PATH=$PATH:/your-directory/git-custom-commands"

Usage

Help

$ git shortuct ?

Create Shortcuts

# Create a simple shortcut
$ git shortuct -n "git status"
Shortcut added as #1

# Create and instantly run any shortcut
$ git shortuct -n -r "git status"
Shortcut added as #1
... git status runs

# Create shortcut with runtime parameters
# When running this shortcut, you can provide any value for <msg>
$ git shortuct -n "git commit -m <msg>"
Shortcut added as #2

Run Shortcuts

# List shortcuts first
$ git shortcut
Saved shortcuts:

1: git status
2: git commit -m <msg>

Enter shortcut number(s) to run (space delimited) [or nothing to cancel]:

# Run shortcut(s) immediately
$ git shortcut 1 2
... git status runs
... git commit -m <msg> runs

# Running a shortcut with runtime params
$ git shortcut 2
git commit -m <msg>          [Ctrl+C to cancel | nothing to exclude param]
Enter value for param <msg>:  Init commit
... git commit -m "Init commit" runs

Edit Shortcuts

# List and select shortcut to edit
$ git shortcut -e

Delete Shortcuts

# List and select shortcut to delete
$ git shortcut -d

List Shortcuts

# Only list shortcuts
$ git shortcut -l

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

Please make sure to check your modifications with ShellCheck.

License

MIT

About

Custom git command to save/execute shortcuts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages