IT

귀하의 구성은

lottoking 2020. 6. 16. 08:01
반응형

귀하의 구성은 원격에서 가져 왔지만 그런 참조는 가져 오지 않았습니다.?


풀에 대한이 오류가 발생합니다.

구성이 원격의 참조 'refs / heads / feature / Sprint4 / ABC-123-Branch'와 병합하도록 지정했지만 그러한 참조는 가져 오지 않았습니다.

다른 지점에서는이 오류가 발생하지 않습니다.
이 브랜치의 특별한 점은 다른 브랜치의 이전 커밋에서 생성된다는 것입니다.

내 구성 파일은 다음과 같습니다.

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    url = <url here>
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "new-develop"]
    remote = origin
    merge = refs/heads/new-develop
[branch "feature/Sprint4/ABC-123-Branch"]
    remote = origin
    merge = refs/heads/feature/Sprint4/ABC-123-Branch

이게 무슨 뜻이야

업스트림 (귀하가 부르는 리모콘) origin은 더 이상 지사를 가지지 않았거나 갖지 못했을 것입니다 (이 정보만으로는 알 수 없습니다) feature/Sprint4/ABC-123-Branch. 그에 대한 일반적인 이유 중 하나가 있습니다. 누군가 (아마도 당신이 아니거나 기억할 것입니다) 다른 Git 저장소에서 지점을 삭제했습니다.

해야 할 일

이것은 당신이 원하는 것에 달려 있습니다 . 아래의 토론 섹션을 참조하십시오. 당신은 할 수 있습니다 :

  • 리모컨에서 분기를 만들거나 다시 만들거나
  • 현지 지점을 삭제하거나
  • 당신이 생각할 수있는 다른 것.

토론

실행 중이어야합니다 (실행중인 git pull경우 git merge다른 오류 메시지가 표시되거나 오류 메시지가 표시되지 않음).

를 실행하면 git fetchGit 은 구성 섹션 url아래의 라인을 기준으로 다른 Git에 연결 [remote "origin"]합니다. 힘내 명령 (실행되는지 upload-pack, 무엇보다도 전송) 여러분 힘내 모든 지점의 목록을. git ls-remote이것이 어떻게 작동하는지 볼 수 있습니다 (시도하고 교육적입니다). 다음은 Git 저장소에서 실행할 때 얻을 수있는 스 니펫입니다 git.

$ git ls-remote origin
From [url]
bbc61680168542cf6fd3ae637bde395c73b76f0f    HEAD
60115f54bda3a127ed3cc8ffc6ab6c771cbceb1b    refs/heads/maint
bbc61680168542cf6fd3ae637bde395c73b76f0f    refs/heads/master
5ace31314f460db9aef2f1e2e1bd58016b1541f1    refs/heads/next
9e085c5399f8c1883cc8cdf175b107a4959d8fa6    refs/heads/pu
dd9985bd6dca5602cb461c4b4987466fa2f31638    refs/heads/todo
[snip]

refs/heads/항목은 원격에 존재하는 나뭇 가지를 모두 나열 1 대응은 함께 (ID를 위해 커밋 refs/tags/엔트리 IDS는 커밋보다는 개체 태그를 가리킬 수있다).

Git은 이러한 각 브랜치 이름을 가져와 동일한 섹션 라인 에 따라 변경 합니다 . 이 경우, 힘내 대체 와 함께 예를 들어,. Git은 모든 브랜치 이름으로이를 수행합니다.fetchremoterefs/heads/masterrefs/remotes/origin/master

또한 특수 파일에 원래 이름을 기록합니다 FETCH_HEAD(자신의 .git디렉토리 를 들여다 보면이 파일을 볼 수 있습니다 ). 이 파일은 가져온 이름과 ID를 저장합니다.

The git pull command is meant as a convenience short cut: it runs git fetch on the appropriate remote, and then git merge (or, if so instructed, git rebase) with whatever arguments are needed to merge (or rebase) as directed by the [branch ...] section. In this case, your [branch "feature/Sprint4/ABC-123-Branch"] section says to fetch from origin, then merge with whatever ID was found under the name refs/heads/feature/Sprint4/ABC-123-Branch.

Since nothing was found under that name, git pull complains and stops.

If you ran this as two separate steps, git fetch and then git merge (or git rebase), your Git would look at your cached remotes/origin/ remote-tracking branches to see what to merge with or rebase onto. If there was such a branch at one time, you may still have the remote-tracking branch. In this case you would not get an error message. If there was never such a branch, or if you have run git fetch with --prune (which removes dead remote-tracking branches), so that you have no corresponding remote-tracking branch, you would get a complaint, but it would refer to origin/feature/Sprint4/ABC-123-Branch instead.

In either case, we can conclude that feature/Sprint4/ABC-123-Branch does not exist now on the remote named origin.

It probably did exist at one time, and you probably created your local branch from the remote-tracking branch. If so, you probably still have the remote-tracking branch. You might investigate to see who removed the branch from the remote, and why, or you might just push something to re-create it, or delete your remote-tracking branch and/or your local branch.


1Well, all that it is going to admit to, at least. But unless they have specifically hidden some refs, the list includes everything.


This can also happen if you/someone renamed the branch. So follow these steps (if you know that branch name is renamed) Assuming earlier branch name as wrong-branch-name and someone renamed it to correct-branch-name So.

git checkout correct-branch-name

git pull (you'll see this "Your configuration specifies..")

git branch --unset-upstream

git push --set-upstream origin correct-branch-name

git pull (you'll not get the earlier message )


Check if your remote branch is available to pull. I had the same issue, finally realized the remote branch was deleted by someone.


For me it was a case sensitivity issue. My local branch was Version_feature2 instead of Version_Feature2. I re-checked out my branch using the correct casing and then git pull worked.


This error can also be received when the origin branch name has some case issue.

For example: origin branch is team1-Team and the local branch has been checkout as team1-team. Then, this T in -Team and t in -team can cause such error. This happened in my case. So, by changing the local name with the origin branch's name, the error was solved.


I got a similar error when the actual cause was that my disk was full. After deleting some files, git pull began to work as I expected.


In my case I was simply lacking of initial commit on remote branch, so local branch wasn't finding anything to pull and it was giving that error message.

I did:

git commit -m 'first commit' // on remote branch
git pull // on local branch

Just check if someone deleted the branch at remote.


I kept running into this issue. In my case, @Jerreck's comment about case differences in the branch names was the cause of this error. Some Windows tools aren't aware of case sensitivity.

To turn off case-sensitivity in git, run this command:

git config --global core.ignorecase true

Note that this will impact more than branch names. For example, if you have "Foo.h" and "foo.h" in the same directory (not a great idea when building software for Windows) then I suspect you cannot turn off case sensitivity.


For me this happened because i merged a branch dev into master using web interface and then tried to sync/pull using VSCode which was open on dev branch.(its weird that i could not change to master without getting this error.)

git pull
Your configuration specifies to merge with the ref 'refs/heads/dev'
from the remote, but no such ref was fetched.'

It makes sense that is not finding it refs/heads/dev - for me it was easier to just delete the local folder and clone again.


I just got exactly this error when doing "git pull" when my disk was full. Created some space and it all started working fine again.


You can edit the ~/.gitconfig file in your home folder. This is where all --global settings are saved.

Or, use git config --global --unset-all remote.origin.url and after run git fetch with repository url.


I was facing the same issue where my current branch was dev and I was checking out to MR branch and doing git pull thereafter. An easy workaround that I took was I created a new folder for MR Branch and did git pull there followed by git clone.

So basically I maintained different folders for pushing code to different branch.


In my case, i had deleted the original branch from which my current branch derived from. So in the .git/config file i had:

[branch "simil2.1.12"]
    remote = origin
    merge = refs/heads/simil2.0.5
    rebase = false

the simil2.0.5 was deleted. I replaced it with the same branch name:

[branch "simil2.1.12"]
    remote = origin
    merge = refs/heads/simil2.1.12
    rebase = false

and it worked


If another pull just works, it means your internet wasn't connected.

참고URL : https://stackoverflow.com/questions/36984371/your-configuration-specifies-to-merge-with-the-branch-name-from-the-remote-bu

반응형