programing

git pull이 "참조 확인 실패" "로컬 참조 업데이트 실패"

minimums 2023. 6. 12. 21:14
반응형

git pull이 "참조 확인 실패" "로컬 참조 업데이트 실패"

1하여 git 1.6.4.2를 때.git pull다음 오류가 발생했습니다.

error: unable to resolve reference refs/remotes/origin/LT558-optimize-sql: No such file or directory
From git+ssh://remoteserver/~/misk5
 ! [new branch]      LT558-optimize-sql -> origin/LT558-optimize-sql  (unable to update local ref)
error: unable to resolve reference refs/remotes/origin/split-css: No such file or directory
 ! [new branch]      split-css  -> origin/split-css  (unable to update local ref)

해습다봤니다니.git remote prune origin 도움이 되지 하지만 소용이 없어.

다음을 사용하여 로컬 리포지토리를 정리해 보십시오.

$ git gc --prune=now
$ git remote prune origin

maggit-gc(1):

git-gc - Cleanup unnecessary files and optimize the local repository

git gc [--aggressive] [--auto] [--quiet] [--prune=<date> | --no-prune]

       Runs a number of housekeeping tasks within the current repository, such as compressing file revisions
       (to reduce disk space and increase performance) and removing unreachable objects which may have been
       created from prior invocations of git add.

       Users are encouraged to run this task on a regular basis within each repository to maintain good disk
       space utilization and good operating performance.

mangit-remote(1):

git-remote - manage set of tracked repositories

git remote prune [-n | --dry-run] <name>

           Deletes all stale remote-tracking branches under <name>. These stale branches have already been
           removed from the remote repository referenced by <name>, but are still locally available in
           "remotes/<name>".            

저도 그랬어요.저의 경우, 불량 심판은 마스터였고, 저는 다음을 수행했습니다.

rm .git/refs/remotes/origin/master
git fetch

이것은 git가 ref 파일을 복원하도록 만들었습니다.그 후 모든 것이 다시 예상대로 작동했습니다.

이것은 저에게 도움이 되었습니다.

git gc --prune=now

저는 폴더에서 오류가 발생하는 파일을 제거하는 작업을 했습니다..git/refs/remotes/origin/.

Git 참조가 끊어진 원인 중 하나를 추가하고 싶습니다.

가능한 근본 원인

내 시스템(윈도우즈 7 64비트)에서 BSOD가 발생하면 저장된 참조 파일 중 일부(현재 열려 있거나 BSOD가 발생했을 때 기록되는 파일)를 다음으로 덮어씁니다.NULL문자(ASCII 0)입니다.

다른 사람들이 언급했듯이, 이 문제를 해결하려면 잘못된 참조 파일을 삭제하고 저장소를 다시 가져오거나 다시 끌어오기만 하면 됩니다.

오류 메시지:

참조 'refs/remotes/motes/some/refs'을(를) 잠글 수 없음: 참조 'refs/remotes/refs/some/refs'을(를) 확인할 수 없음: 참조가 끊어졌습니다.

솔루션:

합니다.refs/remotes/origin/some/branch에 입니다.%repo_root%/.git/refs/remotes/origin/some/branch.

언더플로트 폴더로 이동한 다음,

사용해 보십시오.

git gc --prune=now

git remote prune origin

git pull

설명:로컬 참조가 업데이트되지 않고 존재하지 않는 참조를 가리키지만 원격 repo(GitHub/BitBucket) 분기가 제거된 것 같습니다.

이 문제를 해결하려면 다음을 수행합니다.

git fetch --prune
git fetch --all
git pull

추가 읽기 - Git 설명서의 참조:

git-fetch - 다른 리포지토리에서 개체 및 참조를 다운로드합니다.

--모두 모든 원격을 가져옵니다.

-- 자르기 가져오기 후 원격에 더 이상 존재하지 않는 원격 추적 분기를 제거합니다.

다음 명령을 실행합니다.

rm .git/refs/remotes/origin/master

git fetch

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

, 모르니시가 , 만당이무엇이신..git/refs/remotes/origin/masterGit References의 Remotes 섹션을 읽을 수 있습니다.

후 가 해결되었습니다..git.

메시지를 보면 삭제해야 하는 파일(특히)을 알 수 있습니다.

은 삭할파아있다니 아래에 있습니다..git/refs/remotes.

방금 거기에 있는 모든 파일을 삭제했고, 정리 순위를 매겼습니다.

git gc --prune=now

그 후에는 모든 것이 잘 작동합니다.

git fetch --prune했습니다.

[marc.zych@marc-desktop] - [~/code/driving] - [Wed May 10, 02:58:25]
[I]> git fetch
error: cannot lock ref 'refs/remotes/origin/user/janek/integration/20170505': 'refs/remotes/origin/user/janek/integration' exists; cannot create 'refs/remotes/origin/user/janek/integration/20170505'
From github.com:zooxco/driving
 ! [new branch]            user/janek/integration/20170505 -> origin/user/janek/integration/20170505  (unable to update local ref)
From github.com:zooxco/driving
[marc.zych@marc-desktop] - [~/code/driving] - [Wed May 10, 02:58:30]
[I]> git fetch --prune
 - [deleted]               (none)     -> origin/user/janek/integration

하지만 원격에서 문제가 되는 분기가 삭제된 것으로 가정합니다.

을 다에추수있다습니에 .~/.gitconfig행할때자가기지치로으동실을 실행할 때 git fetch:

[fetch]
    prune = true

저도 같은 문제가 있었는데 오류가 발생한 파일로 이동하여 문제를 해결했습니다.

\repo\.git\refs\remotes\origin\master

이 파일은 null로 가득 찼습니다. github의 최신 ref로 대체했습니다.

Vojtech Vitek 또는 Michel Krämer답변을 적용한 후에도 "로컬 참조를 업데이트할 수 없습니다" 오류가 반복되면 로컬 AND 마스터 리포지토리에 잘못된 참조가 있을 수 있습니다.

이 경우 두 가지 수정 사항을 모두 적용해야 합니다. 두 가지 수정 사항 사이를 당기거나 밀지 마십시오.

rm .git/refs/remotes/origin/master
git fetch
git gc --prune=now
git remote prune origin

푸시/풀 전에 두 가지 수정 사항을 모두 적용한 후에야 영구적인 해결이 가능했습니다.

저는 다음과 같은 방법으로 해결했습니다.

rm .git/refs/remotes/origin/master
git fetch

그 후에 나는 github으로부터 이 메시지를 받습니다.

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

그래서 제가 다음으로 고친 것은 다음과 같습니다.

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

간단히 말해서, 이 문제는 로컬이 원격에 대한 정보를 가지고 있고 다른 사용자가 원격과 사용자의 변경 사항을 동기화하지 않게 만드는 무언가를 변경할 때 발생합니다.

누군가가 원격 지사를 삭제하고 같은 이름으로 다시 생성했기 때문에 이 문제가 발생했습니다.

이러한 문제를 해결하려면 원격에서 끌어오기 또는 가져오기를 수행합니다.

git remote prune origin

또는 GUI를 사용하는 경우 원격에서 가져오기를 수행합니다.

여기에 이미지 설명 입력

사용해 보십시오.

git pull origin Branch_Name

Branch_Name당신이 현재 있는 지점

만약 당신이 a만 한다면,git pull생성된 다른 모든 지점 이름도 가져옵니다.

이것이 바로 당신이 이것을 얻는 이유입니다.

! [new branch]      split-css  -> origin/split-css  (unable to update local ref)

함께 작업할 수 있었습니다.

git remote update --prune
$ rm .git/refs/remotes/origin/master

$ git fetch

bitbucket.org:xx/mkyong-tutorials

df0eee8..3f7af90  master     -> origin/master

$ git pull

이미 최신 상태입니다.

오류: cannot lock ref"는 단순히 /refs의 정보가 손상되어 Git가 index.lock 파일을 계속 만들 수 없음을 의미합니다.

빠른 수정: 원격을 제거했다가 다시 추가합니다.

1 - 기존 리모컨의 SSH git URL을 복사합니다.다음 명령을 사용하여 터미널에 인쇄할 수 있습니다.

git remote -v

2 - 로컬 Git repo에서 리모컨을 제거합니다.

git remote rm origin

3- 원격을 로컬 레포에 다시 추가합니다.

git remote add origin git@server-address.org:your-username/repo-name.git

4 - 원격 오리진 정리 온라인 포럼의 사용자들은 아래 명령이 그들에게 효과가 있다고 보고했습니다.

git remote prune origin

- 및 5 - 로컬리리정리및최화적토지포▁5▁-화최▁reposgit gc --prune=now

자세한 내용은 다음 문서에서 확인할 수 있습니다. https://linuxpip.org/git-error-cannot-lock-ref/

프로젝트에서 특정 분기의 파일을 수동으로 삭제

.git/refs/remotes/origin/master
 git gc --prune=now
 git pull

저 같은 경우에는 지역 지부에서feature/phase2그리고 그 원격 지점의 이름은feature/phase2/data-model이름 지정 충돌이 문제의 원인이 되어 로컬 지점을 삭제했습니다(보관해야 할 항목이 있으면 이름을 변경할 수 있음).

한다면git gc --prune=now당신을 돕지 마세요. (나 같은 불운)

제가 한 일은 로컬에서 프로젝트를 제거하고 전체 프로젝트를 다시 복제한 것입니다.

나는 타워를 사용하고 있는데 어떤 이유에서인지 내 폴더 이름은.git/refs/remotes/origin/Github소문자로 변경.git/refs/remotes/origin/github문제를 해결했습니다.

Google Drive로 인해 발생한 경우desktop.ini파일

Windows용 Google Drive 클라이언트 생성desktop.ini각 폴더에 있는 파일.Git 저장소가 Google Drive와 동기화되는 디렉토리에 있는 경우desktop.ini파일은 Git 저장소에 다음과 같은 오류를 발생시킵니다.

cannot lock ref 'refs/remotes/origin/desktop.ini': unable to resolve reference 'refs/remotes/origin/desktop.ini': reference broken

이 오류를 해결하려면 다음을 삭제해야 합니다.desktop.inigit 저장소에 있는 파일.

WSL을 설정한 경우 다음 명령을 사용하여 다음을 삭제할 수 있습니다.desktop.ini파일:

참고: ⚠️ 이 명령은 모두 삭제합니다.desktop.ini전체 파일.git디렉터리<project_directory>.

find <project_directory> -type d -name .git -print0 | xargs -0 -I {} find {} -type f -name desktop.ini -print0 | xargs -0 -I {} rm -vf {}

만약 당신이 단지 삭제하기를 원한다면.desktop.ini특정 파일.git디렉토리에서 다음 명령을 사용할 수 있습니다.

find <.git_directory> -type f -name desktop.ini -print0 | xargs -0 -I {} rm -vf {}

이것들을 시도했지만 저에게는 효과가 없었습니다.

$ git gc --prune=now
$ git remote prune origin
$ git fetch --prune

로컬 폴더를 삭제하고 다시 복제하여 이 문제를 해결해야 했습니다.

저도 같은 문제가 있었어요.나는 다음 단계를 따릅니다.

문제가 있는 분기를 다른 분기로 전환

해당 분기 삭제

다시 체크아웃합니다.

참고:- 커밋되지 않은 변경사항을 저장한 후 다시 저장할 수 있습니다.

에서 복제를 시도할 때 이 문제가 발생했습니다.git bundle생성된 파일, 레포를 복제할 수 없기 때문에 다른 답변이 작동하지 않았습니다(그래서).git gc파일 제거/삭제는 불가능했습니다.)

그러나 이 문제를 해결하는 다른 방법이 있었습니다. 바로 의 소스 파일입니다..bundle파일이 다음으로 시작되었습니다.

# v2 git bundle
9a3184e2f983ba13cc7f40a820df8dd8cf20b54d HEAD
9a3184e2f983ba13cc7f40a820df8dd8cf20b54d refs/heads/master
9a3184e2f983ba13cc7f40a820df8dd8cf20b54d refs/heads/master

PACK.......p..x...Kj.0...: (and so on...)

vim으로 네 번째 줄을 제거하는 것만으로 문제가 해결되었습니다.

저는 용한사를 요.git prune origin그리고 그것이 일을 끝냈습니다.

이 문제를 일으킬 수 있는 특정 사례를 기록합니다.

어느 날 저는 "feature/subfeature"라는 이름의 브랜치를 리모트에 있는 "feature" 브랜치를 눌렀습니다.

은 제 없이 잘 제 이 가지를 때, 은 모두 정확히 오류 메시지를 .unable to update local ref,cannot lock ref 'refs/remotes/origin/feature/subfeature.

이 문제는 삭제를 통해 해결되었습니다.feature(branch remotegit push --delete origin feature ) 후행실실git remote prune origin 내동들의에서고보다과같, 생다니습성했를시메지은음료▁including를 포함한 메시지를 생성했습니다.* [pruned] origin/feature.

그래서 제 추측은.git fetch를 만들려고 .subfeature을 고치다, 고치다feature on " "on git internal "git/...", "folder on git"이 를 만들지 .feature이미 심판을 보다

사용해 보십시오.git branch --unset-upstream

아까는 문제가 있었는데 단말기에서 이 명령어를 보고 해결했습니다.

 # remove the reference file of the branch "lost"
 rm -fv ./.git/refs/remotes/origin/feature/v1.6.9-api-token-bot-reader
 
 # git clear everything 
 clear ; git reset HEAD --hard ; git clean -xdf ; 

 # subdue the current branch and pull all changes from the remote
 clear ; git fetch --all -p ; git pull --all --rebase ; clear ; git branch -a

 # git will "know" how-to handle the issue from now on
 #     From github.com:futurice/senzoit-www-server
 # * [new branch]      feature/v1.6.9-api-token-bot-reader ->
 # origin/feature/v1.6.9-api-token-bot-reader

 # and push your local changes
 git push

언급URL : https://stackoverflow.com/questions/2998832/git-pull-fails-unable-to-resolve-reference-unable-to-update-local-ref

반응형