[LINUX] Git [fatal: update_ref failed for ref'HEAD': cannot update the ref ~] Solution

Overview

--fatal: update_ref failed for ref'HEAD': cannot update the ref ~ What to do when --When working on multiple PCs (linux and windows this time), the file permissions have changed and only the root user can work. --It may also be possible to run git with sudo. --If you fix the authority, it will be solved.

Contents

  1. Let's look at the permissions of the folder managed by git below. In particular, check in .git and newly added files.
    -  ls -la
  1. If you have a file with user privileges root, do the following:

--sudo chown -R user name: group name The managed folder name

end

--It should be solved.

Recommended Posts

Git [fatal: update_ref failed for ref'HEAD': cannot update the ref ~] Solution