git - github error: insufficient permission for adding an object to repository database -


i used able do, app folder:

git add . git commit -m "commit details" git push 

and latest version of app on local machine backed on in master repo, on github.

now, when far git add . command, get:

mycompaq@ubuntu:~/myapp$ git add . error: insufficient permission adding object repository database .git/objects  error: app/views/reviews/update.js.erb: failed insert database error: unable index file app/views/reviews/update.js.erb fatal: updating files failed mycompaq@ubuntu:~/myapp$  

i read in message on stackoverflow way overcome similar problem with:

chown -r user:user /project/directory 

but seeing got in whole load of trouble in first place running commands wasn't sure about, want know if command me. do? can undone?

what should exact syntax be, if user 'christophe', , folder rails app stored called 'myapp'. mean should

chown -r user:christophe /myapp/app/views/reviews/update.js.erb 

sorry questions.

chown [ -f ] [ -h ] [ -r ] owner [ :group ] { file ... | directory ... } 

from man page

the chown command changes owner of file specified file parameter user specified owner parameter. value of owner parameter can user id or login name found in /etc/passwd file. optionally, group can specified. value of group parameter can group id or group name found in /etc/group file.

about -r option

-r
descends directories recursively, changing ownership each file. when symbolic link encountered , link points directory, ownership of directory changed directory not further transversed.

so

chown -r user:christophe /myapp/app/views/reviews/update.js.erb 

would change owner of update.js.erb file user user in group christophe, not want.

in case changing owner of repo yourself, i.e.

sudo chown -r christophe /path/to/your/local/repo 

should suffice.

if don't know user name, can find out whoami command.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -