LoginSignup
1
0

More than 5 years have passed since last update.

git add しようとしたら全然できなくて困った話

Last updated at Posted at 2018-10-31

git addをしようとした時に事件は起きた

新しくリポジトリを作ったので
・new repositoryの作成
・sshキーを作り登録
とか諸々を行なった上で

rails new hoge

してRails プロジェクトを作成

git add .

としたところ

warning: unable to access '/Users/myname/.config/git/ignore': Permission denied
warning: unable to access '/Users/myname/.config/git/attributes': Permission denied

と権限がないと怒られてしまった。

こちらを参考に~/.bashrc fileを編集したところ

warning: unable to access '/Users/myname/.config/git/attributes': Permission denied

のみのエラーになった。

このエラーがなかなか解決しなかったのですが、色々と探してみたところ

こちらのなかにある

sudo -u root -H env

を試したところ、エラーが消えました。

無事にadd commit pushまでできました。

うーん、なんだったんだろうか。権限問題。。

1
0
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
0