programing

현재 분기에 대한 추적 정보가 없습니다.

topblog 2023. 5. 3. 20:44
반응형

현재 분기에 대한 추적 정보가 없습니다.

저는 비교적 짧은 기간부터 github을 사용했고, 항상 클라이언트를 사용하여 커밋과 풀을 수행했습니다.어제 gitbash에서 시도해보기로 했고, 새 repo를 만들고 파일을 커밋했습니다.

은 다른▁a▁today▁and다수▁performed니오습▁fromitory했▁i▁to행을 수행했습니다.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>

이 레포의 유일한 기여자는 저이며 분기가 없습니다(단, 마스터).저는 창문에서 gitbash에서 pull을 수행했습니다.

여기에 이미지 설명 입력

Git 상태:

$ git status
# On branch master
nothing to commit, working directory clean

git 분기:

$ git branch
* master

내가 뭘 잘못하고 있는 거지?

풀링할 분기를 지정할 수 있습니다.

git pull origin master

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

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

이 분기 추적은 리포지토리를 복제할 때 자동으로 설정되지만(기본 분기에만 해당) 기존 리포지토리에 원격을 추가하는 경우에는 직접 추적을 설정해야 합니다.감사하게도, git에 의해 주어진 조언은 그것을 어떻게 하는지 기억하는 것을 꽤 쉽게 만듭니다.

참조: git 체크아웃 태그, git pull이 분기에서 실패함

수니 작 업 추 다 경 수 있 자 습 설 별 록 할 정 을 칭 도 우 음 을 는 하 행 로 가 여 동 으 야 행 해 을 ▁if ▁the.gitconfig파일 이름:

[alias]
    set-upstream = \
       !git branch \
           --set-upstream-to=origin/`git symbolic-ref --short HEAD`

▁message때볼▁를▁when▁you▁see시.There is no tracking information...선택사항:

 git set-upstream
 git push

https://zarino.co.uk/post/git-set-upstream/ 덕분입니다.

컴퓨터드루드의 답변은 훌륭하지만 당신이 원하지 않는 한 수동으로 업스트림을 설정할 필요는 없다고 생각합니다.사람들이 그것이 필요한 단계라고 생각할 수도 있기 때문에 이 답변을 덧붙입니다.

아래와 같이 풀링할 리모컨을 지정하면 이 오류가 사라집니다.

git pull origin master

:origin 및 입니다.master지점 이름입니다.


리모트 이름 확인 방법

git remote -v

리포지토리에서 사용할 수 있는 분기를 확인하는 방법.

git branch -r

1단계

$ 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-to=<remote>/<branch> master

2단계

$ git branch -u origin/master
Branch 'master' set up to track remote branch 'master' from 'origin'.

3단계

$ git pull
Already up to date.

이러한 현상이 발생하는 이유를 이해하고자 하는 사람은 다음과 같은 몇 가지 관련 개념을 사용할 수 있습니다.

  • Git 저장소는 0개 이상의 "리모트"를 가질 수 있으며, 이는 일반적으로 중앙 서버 어딘가에 있는 다른 저장소에 대한 링크로 명명됩니다."git remote -v"로 목록을 표시할 수 있습니다.
  • 다른 서버에서 리포지토리를 복제할 경우 "origin"이라는 기본 원격이 설정됩니다.
  • git push 및 git pull에 대한 전체 구문은 원격 이름과 해당 원격의 분기를 지정하는 것입니다.
  • 로컬 분기를 원격의 분기와 연결할 수 있으므로 풀하거나 누를 때마다 입력할 필요가 없습니다.
  • "git switch branchname" 또는 "git switch -u origin/branchname"을 사용하여 원격 저장소에서 분기를 체크아웃하면 연결이 설정됩니다. ("git switch"는 "git checkout"과 동일)
  • 에 로분작성기다한음를다경음밀로우으어는넣로컬▁it경▁if▁locally우▁you▁with▁branch▁and로 밀어넣으면git push -u origin연관성을 설정할 것입니다.
  • 하지만 만약 당신이 포함하지 않는다면.-u처음 풀 또는 푸시 시에는 연결이 저장되지 않으므로 매번 구체적으로 지정해야 합니다.

다른 답변들이 지적하듯이, 해결책은 다음과 같은 관계를 설정하는 것입니다.git branch --set-upstream-to=origin/branchname서, 디에어origin는 원격의 이름이며, "branchname"은 원격 서버에서 분기를 부르는 이름입니다.그것은 아마도 지역적으로 같은 이름을 가지고 있을 것이지만, 그럴 필요는 없습니다.

Git 2.24(2019년 4분기)를 사용하면 할 필요가 없습니다.

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

다음 작업을 수행할 수 있습니다.

git pull --set-upstream-to=origin/main main

"옵션을 사용한 기본 원격 분기 - works with but not"에서 자세한 내용을 참조하십시오.


Git 2.37(Q3220)을 사용하면 새로운 옵션이 있습니다.

git config --global push.autoSetupRemote true

그럼간한단.git push과 같을 것입니다.git push --set-upstream-to=origin/main main다음을 만들기git pull 커밋을 검색하도록 이미 설정됨origin/main.

이 문제는 원격의 분기에 대한 추적이 현재 분기에 없기 때문에 발생합니다.그래서 두 가지 방법으로 할 수 있습니다.

  1. 특정 분기 이름으로 끌어오기

    git pull origin master

  2. 또는 로컬 분기로 추적할 분기를 지정할 수 있습니다.

    git branch --set-upstream-to=origin/<branchName>

위의 예제를 시도하는 중 다른 컴퓨터에 만든 (비마스터) 분기와 동기화할 수 없습니다.배경으로, 저는 A 컴퓨터에 이 저장소를 만든 다음(git v 1.8) B 컴퓨터에 저장소를 복제했습니다(git 2.14).저는 B사에서 모든 변경을 했지만, A사에서 변경을 풀하려고 했을 때, 위와 같은 오류가 발생하여 변경을 할 수 없었습니다.위의 솔루션과 마찬가지로 다음을 수행해야 했습니다.

git branch --set-upstream-to=origin/<my_branch_name> 
git pull

약간 다르지만 누군가를 돕기를 바랍니다.

다음을 통해 로컬 지점을 만들기 때문에 이 정확한 메시지를 자주 접합니다.git checkout -b <feature-branch-name>원격 분기를 생성하지 않은 상태로 유지됩니다.

모든 작업이 완료되고 현지에서 커밋된 후 수정 사항은 다음과 같습니다.git push -u원격 분기를 생성하고 모든 작업을 푸시한 다음 병합 요청 URL을 생성했습니다.

해라

   git pull --rebase

이 답변이 원래 여기서 답변하는 데 도움이 되기를 바랍니다. https://stackoverflow.com/a/55015370/8253662

이 답변은 다음에 적합합니다.

자신의 레포를 프로젝트에 연결하고 변경 사항을 적용하려는 고객

코코넛의 답변에 따르면

1단계

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-to=<remote>/<branch> master

2단계

git branch -u origin/master
Branch 'master' set up to track remote branch 'master' from 'origin'.

3단계

git pull
Already up to date.

문제

몇 시간 동안 변경 사항을 적용하는 동안 위의 단계를 따릅니다.git add . git commit .그런 다음 아래 단계를 실행하여 성공적으로 밀어냈습니다.

변경사항 푸시하기

실행에 옮기다

git push -f origin master

사용해 보십시오.

git push --set-upstream origin <branch_name>

그렇지않으면

사용하다

git push -u 

무엇을 해야 하는지 알려줄 것입니다.

git branch --set-settings-to=branch/<master_branch>특징/<your_current_branch>

기트풀

이전에 git branch를 생성할 때 발생한 것과 동일한 현상이 발생했습니다.

다음 두 줄을 먼저 실행합니다.

git checkout -b name_of_new_branch # create the new branch
git push origin name_of_new_branch # push the branch to github

그러면:

git pull origin name_of_new_branch

지금은 괜찮을 거예요!

git branch --set-upstream-to=origin/main

$ git branch --set-upstream-to=heroku/master master그리고.

$ git pull

날 위해 일했다!

언급URL : https://stackoverflow.com/questions/32056324/there-is-no-tracking-information-for-the-current-branch

반응형