I have CentOs. I make git and also made owner"s .git folders team "gitdevelopers". In team "gitdevelopers" include User1 and User2. Now i do git-push and also git-pull adjust from user1 and user2. However users in your computers not occupational with error:

git.exe traction -v --no-rebase --progress "origin"error: cannot open .git/FETCH_HEAD: Permission denied

Why?

p.s.:And ns can affix to server through x-shell through login-password user1 and user2.

You are watching: Error: cannot open .git/fetch_head: permission denied

few hrs later::I think difficulty in not appropriate login-password, i beg your pardon git remember.

p.p.s: wherein git conserve login-password pairs? I use ssh-protocol.

p.p.p.s.:OK. I have server CentOs v git. On server is two users. And also I usage TortoiseGit because that windows. Ns configure this so : in each attach system inquiry login and also password for attach to server. And now ns wanted know : 1. Wherein is conserved this login-password 2. I can permanently saved this pair?


git github permissions centos
re-superstructure
follow
edited Mar 16 "15 at 13:50
Helen
asked Mar 16 "15 at 9:06
*

HelenHelen
30711 gold badge22 silver badges55 bronze title
5
add a comment |

7 answers 7


active earliest Votes
62
This operated with me

sudo chown -R $(whoami) .git/
re-superstructure
follow
reply Oct 11 "19 at 12:49

Pablo PapalardoPablo Papalardo
1,01699 silver- badges77 bronze title
2
add a comment |
3
error: cannot open .git/FETCH_HEAD: Permission deniedWas among the first errors that ever before happened to me.

Perhaps you currently knew, yet this is perhaps happening since of not having permissions because that changing/viewing the directory.

The idea is to readjust the permissions, probably use:

chmodor

chownI discovered further answers below Trying to git pull through error: cannot open .git/FETCH_HEAD: Permission denied.


re-publishing
monitor
edited may 23 "17 in ~ 12:17
*

CommunityBot
111 silver badge
answered Mar 16 "15 at 9:12
*

Joey DorraniJoey Dorrani
36711 silver- badge11 bronze argorial
include a comment |
2
you can check for the permissions on the file,

ls -l /usr/local/Library/Taps/linode/cli/.git/FETCH_HEAD

and

ls -l /usr/local/.git/FETCH_HEAD


share
monitor
answer Aug 29 "18 at 9:06
*

RizoRizo
2,60311 yellow badge1818 silver badges1919 bronze title
add a comment |
2
if you room using ubuntu, use sudo an essential word before.

sudo git pullif you space using windows, usage administrator mode


share
follow
answer Sep 26 "19 at 0:12
Mohamed SalmanMohamed Salman
14911 silver- badge77 bronze badges
include a comment |
0
Generating a brand-new SSH key pair

ssh-keygen -o -t rsa -b 4096 -C "email
domain.com"Adding one SSH crucial to her GitLab account

Copy your public SSH crucial to the clipboard and also paste it right into your user account > SSH keys For Authentication you need to collection configuration in ~/.ssh/config as contents bellow;

Host domain.comHostname domain.comUser gitPort 30001Preferredauthentications publickeyRequestTTY noIdentityFile ~/.ssh/id_rsaYou deserve to use commands as; In these command mentioned typical variables, change the connected values of those.

Create a brand-new repository

git clone ssh://git
domain.com:port-number/user-name/project-name.gitcd project-nametouch README.mdgit add README.mdgit walk -m "add README"git press -u beginning masterPush an existing folder

cd existing_foldergit initgit remote add origin ssh://git
domain.com:port-number/user-name/project-name.gitgit add .git walk -m "Initial commit"git push -u origin masterPush an present Git repository

cd existing_repogit far rename beginning old-origingit remote include origin ssh://git
domain.com:port-number/user-name/project-name.gitgit push -u origin --allgit push -u beginning --tagsTo clone repository:

git clone https://git
domain.com:port-number/user-name/project-name.git


share
monitor
edited Feb 26 "20 at 10:08
answered Feb 21 "20 at 10:39
Suresh ShindeSuresh Shinde
10777 bronze badges
add a comment |
0
this operated for me:

sudo chown -R $ USER: name_reponote:in my situation I had actually cloned the repository v the root user and then I began using an additional user


re-publishing
monitor
reply Jun 25 "20 in ~ 16:39
user178088user178088
122 bronze title
include a comment |
0
Delete the present solution and also doing a git clone fixed the worry for me


re-publishing
follow
reply Dec 14 "20 in ~ 5:36
Sudhir RaoSudhir Rao
911 bronze argorial
include a comment |

your Answer


Thanks for contributing response to stack Overflow!

Please be certain to answer the question. Provide details and share your research!

But avoid

Asking for help, clarification, or responding to various other answers.Making statements based on opinion; ago them up with referrals or personal experience.

To find out more, see our advice on writing good answers.

See more: She And Her Love Are No Longer Together, Panessa Studios


Draft saved
Draft discarded

Sign increase or log in in


authorize up utilizing Google
authorize up making use of Facebook
authorize up making use of Email and Password
submit

Post as a guest


surname
email Required, but never shown


Post together a guest


name
email

Required, however never shown


short article Your answer Discard

By clicking “Post your Answer”, friend agree come our terms of service, privacy policy and cookie plan


Not the answer you're looking for? Browse various other questions tagged git github permissions centos or asking your own question.


The Overflow Blog
Upcoming occasions
Featured on Meta
Linked
249
Trying come git pull through error: cannot open up .git/FETCH_HEAD: Permission denied
associated
7424
just how to remove neighborhood (untracked) files from the present Git functioning tree
12824
What is the difference in between 'git pull' and also 'git fetch'?
10070
exactly how do i undo 'git add' before commit?
23327
exactly how do ns undo the many recent neighborhood commits in Git?
8280
Git: exactly how do I force "git pull" come overwrite neighborhood files?
7535
exactly how do I check out a far Git branch?
18502
exactly how do i delete a Git branch locally and also remotely?
4669
How deserve to I identify the URL the a regional Git repository was initially cloned from?
7621
just how do i revert a Git repository come a vault commit?
9781
how do ns rename a regional Git branch?
hot Network concerns much more hot concerns

concern feed
i ordered it to RSS
concern feed To i ordered it to this RSS feed, copy and also paste this URL right into your RSS reader.


ridge Overflow
products
firm
stack Exchange Network
site style / logo © 2021 ridge Exchange Inc; user contributions license is granted under cc by-sa. Rev2021.10.20.40515


Stack Overflow works ideal with JavaScript allowed
*

her privacy

By clicking “Accept every cookies”, you agree stack Exchange deserve to store cookie on your maker and disclose info in accordance with our Cookie Policy.