Skip to content

turtlecoder/git-editor-shell-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

git-core-editor

git-core-editor is a Git editor wrapper for commit messages.

It chooses an editor in this order:

  • If the shell was launched from a JetBrains IDE such as PyCharm, it uses the IDE command-line launcher with --wait.
  • If a GUI Emacs server is already running, it uses emacsclient.
  • Otherwise, it falls back to emacs -nw.

Install

Run the script with --install and pass the directory where you want the command installed:

bash /Users/haroonkhan/projects/git-editor-shell-script/git-core-editor.sh --install ~/.local/bin

This will:

  • Create the target directory if it does not exist
  • Copy the script to DIR/git-core-editor
  • Mark the installed copy as executable

Update PATH

If the install directory is not already on your PATH, add it in your shell startup file:

export PATH="$HOME/.local/bin:$PATH"

For Bash on macOS, add that line to ~/.bash_profile or to whatever startup file your shell loads.

After updating your startup file, reload it or open a new shell.

Configure Git

Point Git at the installed command:

git config --global core.editor "$HOME/.local/bin/git-core-editor"

You can confirm the setting with:

git config --global --get core.editor

Update The Installed Copy

If you change git-core-editor.sh, run the install command again to copy the latest version over the installed command:

bash /Users/haroonkhan/projects/git-editor-shell-script/git-core-editor.sh --install ~/.local/bin

Requirements

  • For IDE editing, install a JetBrains command-line launcher such as charm, pycharm, or idea.
  • For GUI Emacs editing, run an Emacs server that emacsclient can connect to.
  • If neither is available, emacs -nw must be installed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages