chmod: changing permissions of 'index.html' : Operation not permitted
chmod +w index.html 을 해주려하니까 위의 내용과 같은 에러메세지가 뜸.
👾 sudo chown $(whoami) index.html
fatal: detected dubious ownership in repository at '/home/pnubuddy/github/P-bud’
👾 `git config --global --add safe.directory [디렉토리 명]`
으로 safe directory로 등록해줄 수 있다.
git add . 을 시도함 .. 그런데 또fatal: Unable to create '/home/pnubuddy/github/P-bud/.git/index.lock': Permission denied
가 뜸..;;
.git 디렉토리에 쓰기 권한이 없기 때문에 생기는 오류라고 한다 . ( 또 권한이 ..ㅡㅡ ; )👾 `sudo chown $(whoami):$(whoami) /home/pnubuddy/github/P-bud/ -R`
or
👾`sudo chown -R yourusername:yourgroup /path/to/directory`
를 통해 소유권을 변경해줄 수 있다.
chown은 change owner 의 약자로 파일이나 디렉토리에 대한 소유권을 변경하는 명령어이다.-R 옵션은 해당 디렉토리에 하위 디렉토리 파일이 있는 경우 그 디렉토리에도 재귀적(Recursive)으로 작용하게 하기위한 옵션이다.
👾 sudo chmod -R 775 .git
//fatal: detected dubious ownership in repository at '/home/pnubuddy/github/P-bud’
sudo chown $(whoami) [파일명]
//fatal: detected dubious ownership in repository at '/home/pnubuddy/github/P-bud’
sudo chown -R <username>:<usergroup> .git
sudo chmod -r 775 .git