If you want to change the default editor that is used when you diff or commit to git, you need to make use of the git config command to set the global value for core.editorExample 1: To set the editor as vi (or vim)
Example 2: To set the editor as nano
% git config --global core.editor vi
Example 3: To set the editor as sublime
% git config --global core.editor nano
Example 4: To set the editor as visual studio code (vscode)
% git config --global core.editor "subl -n -w"
Example 5: To set the editor as Nodepad++
% git config --global core.editor "code -w"
Example 6: To set the editor as Atom
% git config --global core.editor "C:/Program Files/Notepad++/notepad++.exe' -multiInst"
% git config --global core.editor "atom -w"
Once you set your favorite editor, you will see that the commit command opens it up!
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch master # Changes to be committed: # new file: a.txt # ~ ~ ~ ~ "/myproj/.git/COMMIT_EDITMSG" 8L, 206B 1,0-1
- [Fixed] Git Clone email@example.com: Permission denied (publickey) Could not read from remote repository Fatal error
- Github: How to Invite Collaborators
- Git Commit - Author identity unknown, Please tell me who you are email
- [Solution] fatal: not a git repository (or any of the parent directories): .git
- [fix] zsh: command not found: git
- Github: fatal: Authentication failed Support for password was removed on August 13, 2021
- Get List of all local branches git command
- Git Revision Questions Before the Interview
- git fatal: Authentication failed error [fix]
- How to Install Git on Ubuntu Linux
- GitHub: How to Search Code
- How to change Git Default Author and Committer details in Eclipse
- How to check your installed version of Git
- Install GitHub Command Line Tool on Mac
- How to Merge Branch into Master Branch
- Perform an Empty Commit in Git without anything in Staging Area
- Git Fix: fatal: refusing to merge unrelated histories Error
- How to undo last Git Commit on Local Repository?
- git command to remove/unstage files from staging area
- Step-by-Step: Setting up Docker + Ubuntu Linux + Git + GitHub Tutorial
- Remove git config at Local, Global or System Levels?
- Fix [oh-my-zsh] Cant update: not a git repository
- Git Config Command - A Deep Dive
- fatal: Unable to create '/c/git_repo/.git/index.lock': File exists. If no other git process is currently running, this probably means a git process crashed in this repository earlier.
- How to change directory in Git bash
- How to Open PowerShell on Mac? - Powershell
- fatal: Unable to create '/c/git_repo/.git/index.lock': File exists. If no other git process is currently running, this probably means a git process crashed in this repository earlier. - Git
- Android Launch! The connection to adb is down, and a severe error has occured - Android
- Android Studio : Connection Error : Failed to download patch file - Android-Studio
- airbnb website and mobile App is down worldwide - clear browser cache or reinstall app to fix error - News
- [macOS] How to search or view previous terminal command history - MacOS
- How to shuffle lines randomly in Sublime Text - Sublime-Text
- Convert JSON to XML using Java Jackson Library - Java