IT TIP

치명적 : git 저장소로 보이지 않음

itqueen 2020. 10. 29. 20:16
반응형

치명적 : git 저장소로 보이지 않음


내 git 저장소 URL이 올바른 데 왜이 오류가 발생합니까?

jitendra@JITENDRA-PC /c/mySite (master)
$ git push beanstalk master
fatal: 'git@skarp.beanstalkapp.com/gittest.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

jitendra@JITENDRA-PC /c/mySite (master)
$ git clone git://github.com/jquery/jquery.git
Cloning into jquery...
Remote: Counting objects: 19803, done.
Remote: Compressing objects: 100% (5196/5196), done.
Remote: Total 19803 (delta 14204), reused 19549 (delta 14052)
Receiving objects: 100% (19803/19803), 12.80 MiB | 591 KiB/s, done.
Resolving deltas: 100% (14204/14204), done.

jitendra@JITENDRA-PC /c/mySite (master)
$ gitk --all

jitendra@JITENDRA-PC /c/mySite (master)
$ gitk -all

jitendra@JITENDRA-PC /c/mySite (master)
$ git remote add origin git@skarp.beanstalkapp.com/gittest.git

jitendra@JITENDRA-PC /c/mySite (master)
$ git push origin master
fatal: 'git@skarp.beanstalkapp.com/gittest.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

jitendra@JITENDRA-PC /c/mySite (master)

편집 : 원본 스크린 샷 교체

편집하다:

fatal: 'git@skarp.beanstalkapp.com/gittest.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

scp저장소를 지정하는 방식에 대한 구문이 약간 잘못 되었습니다. 다음과 같아야합니다.

[user@]host.xz:path/to/repo.git/

... git clone 문서 에서 볼 수 있습니다 . 대신 URL을 사용해야합니다.

git@skarp.beanstalkapp.com:/gittest.git

즉, 사용중인 URL에서 :(콜론) 을 놓쳤습니다.

원본의 URL을 업데이트하려면 다음을 수행하십시오.

git remote set-url origin git@skarp.beanstalkapp.com:/gittest.git

Ubunt One계정에 기존 저장소를 저장하려고 할 때 비슷한 문제가 발생 하여 다음 단계로 해결했습니다.

1 단계 : 원격 저장소 생성

$ cd ~/Ubuntu\ One/
$ mkdir <project-name>
$ cd <project-name>
$ mkdir .git
$ cd .git
$ git --bare init

2 단계 : 리모컨 추가

$ git remote add origin /home/<linux-user-name>/Ubuntu\ One/<project-name>/.git

3 단계 : 기존 git reop을 원격으로 푸시

$ git push -u origin --all

이는 일반적으로 Git 리포지토리에 원본 별칭을 설정하지 않았기 때문입니다.

시험

git remote add origin URL_TO_YOUR_REPO

그러면 .git/config원격 복제 / 푸시 / 풀 사이트 URL 에 대한 별칭이 파일에 추가됩니다 . 이 URL은 저장소 개요 페이지에서 찾을 수 있습니다.


내 로컬 및 원격 시스템은 모두 OS X입니다. xCode Server가 제공하는 git repo의 파일 구조를 확인할 때까지 문제가 발생했습니다. 본질적으로 모든 것은 해당 저장소의 chmod 777 *이므로 원격 계정의 동일한 컴퓨터에 별도의 비 xCode 저장소를 설정하기 위해 다음과 같이했습니다.

원격 기계

  1. 계정에 로그인
  2. 모든 프로젝트 'mkdir git'에 대한 마스터 디렉토리 생성
  3. chmod 775 git 그런 다음 cd
  4. 프로젝트 폴더 'mkdir project1'만들기
  5. chmod 777 project1 그런 다음 cd
  6. 저장소를 만들기 위해 'git init'명령을 실행하십시오.
  7. 이것은 .git dir을 생성합니다. 'chmod 777 .git'명령을 수행 한 다음 cd
  8. .git 777 mod의 모든 파일을 만들려면 'chmod 777 *'명령을 실행하십시오.
  9. cd back out to myproject1 (cd ..)
  10. setup a test file in the new repo w/command 'touch test.php'
  11. add it to the repo staging area with command 'git add test.php'
  12. run command "git commit -m 'new file'" to add file to repo
  13. run command 'git status' and you should get "working dir clean" msg
  14. cd back to master dir with 'cd ..'
  15. in the master dir make a symlink 'ln -s project1 project1.git'
  16. run command 'pwd' to get full path
  17. in my case the full path was "/Users/myname/git/project1.git'
  18. write down the full path for later use in URL
  19. exit from the REMOTE MACHINE

LOCAL MACHINE

  1. create a project folder somewhere 'newproj1' with 'mkdir newproj1'
  2. cd into it
  3. run command 'git init'
  4. make an alias to the REMOTE MACHINE
  5. the alias command format is 'git remote add your_alias_here URL'
  6. make sure your URL is correct. This caused me headaches initially
  7. URL = 'ssh://user@www.somemachine.com/Users/myname/git/project1.git'
  8. after you do 'git remote add alias URL' do 'git remote -v'
  9. the command should respond with a fetch and push line
  10. run cmd 'git pull your_alias master' to get test.php from REMOTE repo
  11. after the command in #10 you should see a nice message.
  12. run command 'git push --set-upstream your_alias master'
  13. after command in 12 you should see nice message
  14. command in #12 sets up REMOTE as the project master (root)

For me, i learned getting a clean start with a git repo on a LOCAL and REMOTE requires all initial work in a shell first. Then, after the above i was able to easily setup the LOCAL and REMOTE git repos in my IDE and do all the basic git commands using the GUI of the IDE.

I had difficulty until I started at the remote first, then did the local, and until i opened up all the permissions on remote. In addition, having the exact full path in the URL to the symlink was critical to succeed.

Again, this all worked on OS X, local and remote machines.


I had a similar problem when using TFS 2017. I was not able to push or pull GIT repositories. Eventually I reinstalled TFS 2017, making sure that I installed TFS 2017 with an SSH Port different from 22 (in my case, I chose 8022). After that, push and pull became possible against TFS using SSH.


It is most likely that you got your repo's SSH URL wrong.

To confirm, go to your repository on Github and click the clone or download button. Then click the use SSH link.

ssh link

Now copy your official repo's SSH link. Mine looked like this - git@github.com:borenho/que-ay.git

You can now do git remote add origin git@github.com:borenho/que-ay.git if you didn't have origin yet.

If you had set origin before, change it by using git remote set-url origin git@github.com:borenho/que-ay.git

Now push with git push -u origin master


I have a similar problem, but now I know the reason.

After we use git init, we should add a remote repository using

git remote add name url

Pay attention to the word name, if we change it to origin, then this problem will not happen.

Of course, if we change it to py, then using git pull py branch and git push py branch every time you pull and push something will also be OK.

참고URL : https://stackoverflow.com/questions/7318918/fatal-does-not-appear-to-be-a-git-repository

반응형