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
- Change the default git branch name from master to main
- [Fixed] Git Clone firstname.lastname@example.org: Permission denied (publickey) Could not read from remote repository Fatal error
- [Solution] fatal: not a git repository (or any of the parent directories): .git
- [fix] zsh: command not found: git
- How to Install Git on Windows
- Setup Git + Visual Studio Code Tutorial
- How to undo last Git Commit on Local Repository?
- Install GitHub Command Line Tool on Mac
- How to Create a Git Branch in 6 Different ways
- Fix Git: Warning: could not find UI helper GitHub.UI on Windows
- Git Config Command - A Deep Dive
- Step-by-Step: How to delete a git branch from local as well as remote origin
- How to Add Git Bash Option to Windows Terminal List
- Command to Clone Repository Using Git Bash
- How to remove or unstage a file from git staged area
- Get the file location of git config values
- GitHub: How to Search Code
- How to check your installed version of Git
- Fix: error: src refspec master does not match any failed to push some refs to Git
- Git: Step-by-Step - How to Push Local Brach to GitHub
- How to Merge Branch into Master Branch
- fix fatal: --local can only be used inside a git repository error
- Fix: Git Pull Error: unable to resolve reference refs/remotes/origin/master: reference broken
- Change the default diff or commit editor for git
- Git Fix: fatal: refusing to merge unrelated histories Error
- Find and Replace Multiple different words with the same word in a text file - NotepadPlusPlus
- [Fix] Spring Boot: java.sql.SQLSyntaxErrorException: Unknown database - Java
- How to connect to SSH port other than default 22 - Linux
- 25 Notepad++ Command Argument List - NotepadPlusPlus
- How to Clear All Cells Output in Jupyter Notebook - Python
- How to Set Up Dual Monitors on a Windows 11 PC - Windows-11
- [Notepad++] Remove CR Carriage Return and LF Line feed (CRLF) - NotepadPlusPlus
- Trace using cURL Command Example - cURL