ProgramingTip

git : "branchname"과 "refs / head / branchname"의 차이점

bestdevel 2020. 10. 21. 21:13
반응형

git : "branchname"과 "refs / head / branchname"의 차이점


예를 들어 설명하는 것이 좋습니다. 나는 저장소의 0.58 지점에 있고 내가 어떻게 당기는 지에 대한 것입니다.

git pull origin 0.58

"git pull"을 호출하면 다음과 같이 표시됩니다.

ip238:openlierox az$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.0.58.merge' in
your configuration file does not tell me either.  Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details on the refspec.

If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:

    branch.0.58.remote = <nickname>
    branch.0.58.merge = <remote-ref>
    remote.<nickname>.url = <url>
    remote.<nickname>.fetch = <refspec>

See git-config(1) for details.

이 분기를 확인했을 때 옵션 (--track?)을 잊은 것입니다. 어쨌든, 나는 지금 설정했습니다.

git config branch.0.58.merge 0.58
git config branch.0.58.remote origin

그리고 작동하는 것입니다. 그런 다음 관심을 가지고 있습니다.

ip238:openlierox az$ git config branch.0.57.merge
refs/heads/0.57
ip238:openlierox az$ git config branch.0.57.remote
origin

지금 궁금해서 "0.58"사이에 차이가 있습니까? 또는 "refs / heads / 0.58"을 지정해야합니까?

정확히 차이점은 무엇입니까?


(예 : 브랜치 (헤드), 태그 및 원격 브랜치). 저장소에 세 가지 유형의 참조가 모두 표시 가정하면 .git / refs 디렉토리에 heads, remotes 및 태그가됩니다.

refs / heads / 0.58 은 0.58이라는 분기를 지정합니다 . ref가있는 네임 스페이스를 지정하지 네임 git은 기본 네임 스페이스를 찾습니다. 이로 인해 0.58 만 사용하면 모호 할 수 있습니다. 0.58 분기와 태그를 모두 잇습니다.


궁금한 사람을 위해 -Git v1.8.2.2부터 사용할 수있는 로컬 저장소에있는 모든 참조를 표시합니다.git show-ref


참조는, branchNameGIT는 사실을 확인하기 전에 완전히 해결 될 필요가 있습니다. 완전히 확인 된 이름은입니다 refs/heads/branchName.

유명한 명령 중 하나가 git checkout branchName실제로 자동으로 해결하여 체크 아웃 할 위치를 포토합니다. 자동으로 수행 할 것입니다.

어떻게하나요? 여기를 보자

refname : 예 master, heads/master,refs/heads/master

상징적 인 참조 이름. 예를 들어 마스터는 일반적으로 참조하는 커밋 객체를 의미합니다 refs/heads/master. heads/master둘 다있는 경우 Git에게 의미하는 것을 tags/master명시 적으로 말할 수 있습니다 heads/master. 모호한 경우 <refname>는 다음 규칙에서 첫 번째 일치 항목을 가져옴 명확하게 처리합니다.

설치 1. $GIT_DIR/<refname>당신이 무슨 뜻인지입니다 존재는, (이것은 단지에 일반적으로 유용 HEAD, FETCH_HEAD, ORIG_HEAD, MERGE_HEADCHERRY_PICK_HEAD);

2. refs/<refname>개체 존재하는 경우

3. refs/tags/<refname>개체 존재하는 경우

4. refs/heads/<refname>개체 존재하는 경우

5. refs/remotes/<refname>개체 존재하는 경우;

6. refs/remotes/<refname>/HEAD개체 존재하는 경우.

따라서 위의 6 개를 통해이 문제를 해결하려고합니다 branchName. 따라서 완전히 해결 된 branchName을 제공 할 필요가 없습니다.

여기여기도 보세요 .

또한 .git디렉토리 로 이동 하여 ref폴더 내부를 확인하십시오 .

참고 URL : https://stackoverflow.com/questions/1526471/git-difference-between-branchname-and-refs-head-branchname

반응형