1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Git [fatal: update_ref failed for ref 'HEAD': cannot update the ref ~] 解決方法

Posted at

概要

  • fatal: update_ref failed for ref 'HEAD': cannot update the ref ~ と出たときの対処法
  • 複数のPC(今回はlinuxとwindows)で作業していると、fileの権限が変わっていてroot userでしか作業できなくなったりする。
  • gitをsudo実行したりしてもなる可能性がある。
  • 権限を直せば解決する。

内容

  1. 以下でgit 管理しているフォルダの権限を見てみる。特に、.gitの中や、新しく追加したファイルを確認する。
    -  ls -la

2 . user権限がrootになっているファイルがあれば、以下を実行する。

- sudo chown -R user名:group名 管理しているfolder名

おわり

  • 解決するはず。
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?