programing

git-끌어 오기를 시도하고 혼란스러운 메시지를받는 새로운 사용자

nasanasas 2020. 11. 14. 10:17
반응형

git-끌어 오기를 시도하고 혼란스러운 메시지를받는 새로운 사용자


나는 git을 처음 접했습니다. 나는 주로 저장소에 물건을 체크인했지만 이제는 다른 개발자로부터 최신 변경 사항을 얻고 싶습니다.

나는 단순히 git pull무언가가 실행되는 것과 같은 명령을 시도했지만 다음과 같은 메시지와 함께 돌아 왔습니다.

There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream develop origin/<branch>

그래서 나는 git pull my_branch_name

그리고 이것과 함께 돌아 왔습니다.

fatal: 'develop' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

그러나 나는 git checkout my_branch그 직전에했습니다.

누군가 내가 뭘 잘못했는지 알려주고 체크인 한 최신 파일을 간단히 가져올 수있는 방법을 알려주시겠습니까?

감사!


당길 때 리모컨의 이름을 놓친 것 같습니다.

git pull <remote> my_branch_name

다음 명령을 실행하십시오.

git remote -v

그리고 가져 오려는 리모컨의 이름이 무엇인지 확인하십시오.

편집하다:

Git을 처음 사용하는 경우이 책을 추천합니다 . 기본 주제부터 고급 주제까지 다루며 이해하고 읽기 쉽습니다.


첫 번째 오류 메시지에서 알 수 있듯이 해당 분기를 가져올 때 찾을 위치를 git에게 알려야합니다.

Git 1.8 이상에서 개발 및 실행을 확인했는지 확인하십시오.

git branch --set-upstream-to origin/develop

또는 더 짧은 :-

git branch -u origin/develop

1.8 이전 버전의 Git에서 :

git branch --set-upstream develop origin/develop

이 작업을 완료 git pull하면 원격 또는 분기를 지정하지 않고도 할 수 있습니다 .

원격 오리진이 아직 설정되지 않은 경우 먼저 다음을 실행하십시오.

git remote add origin url


이 명령을 시도하십시오.

git pull origin master
git push -u origin master

가져올 분기를 지정할 수 있습니다.

git pull origin master

또는 로컬 마스터 브랜치가 github 마스터 브랜치를 업스트림으로 추적하도록 설정할 수 있습니다.

git branch --set-upstream-to=origin/master master
git pull

이 분기 추적은 저장소를 복제 할 때 자동으로 설정되지만 (기본 분기에만 해당) 기존 저장소에 원격을 추가하는 경우 추적을 직접 설정해야합니다. 고맙게도 git이 제공하는 조언을 통해 수행 방법을 쉽게 기억할 수 있습니다.

--set-upstream is deprecated in git 1.9.x, apparently. Going forward you'd want to use something like

git branch -u origin/master

assuming you've checked out master already. If not, git branch -u origin/master master will work


What I like to do is...

$ git checkout master
$ git pull
$ git checkout <remotebranch>
$ git rebase master

참고URL : https://stackoverflow.com/questions/12054223/git-new-user-trying-to-do-pull-and-getting-some-confusing-messages

반응형