
나는 루트를 통해 내 vps에 git repo를 생성하고 이를 공유하여 여러 사람들이 액세스할 수 있도록 했습니다.
# mkdir example.git
# cd example.git
# git init --bare --shared=group
Initialized empty shared Git repository in /root/example.git/
# ls
branches config description HEAD hooks info objects refs
# chgrp -R devs .
그런 다음 내 로컬 PC의 사용자로서 디렉터리를 만들고 이 git repo의 새 원본으로 example.git을 추가했습니다. 마지막으로 원점으로 푸시를 시도했습니다.
mkdir bubbles && cd bubbles
bubbles ranuka$ git init
Initialized empty Git repository in /Users/ranuka/Desktop/bubbles/.git/
bubbles ranuka$ ls
bubbles ranuka$ git remote add origin [email protected]:example.git
bubbles ranuka$ echo "Hello" > readme.txt
bubbles ranuka$ git add readme.txt
bubbles ranuka$ git commit -m "Adding a readme file"
[master (root-commit) 2c89e43] Adding a readme file
1 file changed, 1 insertion(+)
create mode 100644 readme.txt
bubbles ranuka$ git push origin master
[email protected]'s password:
fatal: 'example.git' does not appear to be a git repository
example.git이 분명히 내 vps의 저장소라는 것을 알고 있기 때문에 이 오류로 인해 혼란스러워졌습니다. 내 vps에 'ranuka'로 로그인하고 example.git에 CD를 넣으려고 했지만 실패했지만 어떤 이유로 루트로 로그인할 수 있었습니다. 무엇이 제공됩니까?
내 목표는 특정 그룹의 여러 사용자가 액세스하고 푸시/풀을 수행할 수 있는 vps에 git repo를 만드는 것이었습니다.
편집 : ls -a를 실행 한 후[이메일 보호됨]그리고[이메일 보호됨] 결과는 다음과 같습니다.
. example.git
.. gitosis
ajenti-repo-1.0-1.noarch.rpm install.log
anaconda-ks.cfg install.log.syslog
.bash_history pgdg-centos93-9.3-1.noarch.rpm
.bash_logout .pki
.bash_profile repo.git
.bashrc .rnd
.cshrc .ssh
epel-release-6-8.noarch.rpm .tcshrc
그리고
. .. .bash_logout .bash_profile .bashrc
따라서 루트와 라누카는 아무런 관계 없이 서로 다른 디렉터리에 있는 것처럼 보입니다.
답변1
사용자마다 홈 폴더가 다릅니다.
루트로 로그인하면 집은 입니다 /root
.
다른 사용자는 해당 항목에 액세스할 수 없습니다.
ranuka로 로그인하면 집은 (아마도) 입니다 /home/ranuka
.
물론 폴더가 포함되어 있지 않습니다 /root
.