잘 작동하는 것 :git push가 실패합니다 - 내가 뭘 잘못하고 있니? 구성 및 자식 로컬 보인다 작업
~/sb/proj1> cd /home
~> mkdir temp-repo
~> cd temp-repo/
~/temp-repo> git init --bare
Initialized empty Git repository in /home/temp-repo/
~/temp-repo> cd ~/sb/proj1/
~/sb/proj1> git clone /home/temp-repo/
Cloning into temp-repo...
done.
warning: You appear to have cloned an empty repository.
~/sb/proj1> git push origin master
fatal: 'origin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
참고 : 나는 중앙 저장소에 push이하려고 할 때
~/sb> mkdir proj1
~/sb> cd proj1
~/sb/proj1> echo "asdf" > file1.txt
~/sb/proj1> git init
~/sb/proj1> git add .
~/sb/proj1> git commit -a -m "Import"
~/sb/proj1> git branch
* master
문제는 시작하는 --bare
및 origin master
위에 있었다 여기에 게시 된 문제의 해결책에서 가져온 것 : pushing to a git repository does not work
그러나 나는 실종 된 것을 알아 내지 못합니다. 사소한 것이어야하지만 그게 뭐야?
UPDATE : @Firoze Lafeer에 의해 답은 아래에 작동합니다
~/sb/proj1> cd /home
~> mkdir temp-repo
~> cd temp-repo/
~/temp-repo> git init --bare
Initialized empty Git repository in /home/temp-repo/
~/temp-repo> cd ~/sb/proj1/
~/sb/proj1> git remote add origin /home/temp-repo
~/sb/proj1> git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 230 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To /home/temp-repo
* [new branch] master -> master
~/sb/proj1>
이제 그 이유를 이해할 필요가있다. 특히
this answer에서 내가 오해 한 점은 앞에
git clone
을 제안한 것입니다.
** 베어 저장소 ** : '--bare' 옵션을 사용하여 복제 된 저장소는 .git 디렉토리 안에있는 파일/폴더 만 포함합니다. – WinWin
** 비 - 베어 리 저장소 ** : 일반 복제본에는 체크 아웃 된 파일들로 작업 디렉토리 *. – WinWin