myrepo$ git config --system core.editor "nano -w" error: could not lock config file /etc/gitconfig: Permission denied
If you are trying to add or edit a system configuration file you will get a Permission denied error because you need special privileges to access it.Fix:
For the above example, it is better to set the core.editor at the user level using the --global configuration.
If you really want to set a property at the system level make use of sudo
sudo git config --system core.editor "nano -w"
Again you should have special privileges to do so, if not you will get sudoers error.
[sudo] password for user1: user1 is not in the sudoers file. This incident will be reported.
Have Questions? Post them here!
More Posts related to Git,
- [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
- Cant find System Preferences... under macOS Ventura Apple Menu? - MacOS
- Enable Dark Mode in Gmail Desktop Browser - Google
- Enable and reduce background noise in Microsoft Teams with AI-based noise suppression - Teams
- Using Document Map in Notepad++ - NotepadPlusPlus
- How to integrate Salesforce CRM Sales and Service with Microsoft Teams - Teams
- [fix] RabbitMQ: AuthenticationFailureException ACCESS_REFUSED Login refused authentication mechanism PLAIN - 2022
- How to use Autocomplete and Autosuggestion in Shell Commands - Bash