2017-02-02 18 views
0

업데이 트의 경우 가져 오기 위해 예상되는 동작은 다음 (IMHO) 인 :자식이 가져 : 출력을 업데이 트가 있다고

$ git fetch -p 
remote: Counting objects: 3, done. 
remote: Compressing objects: 100% (3/3), done. 
remote: Total 3 (delta 2), reused 0 (delta 0) 
Unpacking objects: 100% (3/3), done. 
From AAA 
    a061e40..2058467 develop -> origin/develop 

이 같은 자식 호스트에서 가져 오기 프로젝트 A에 나를 위해 작동 , 동일한 로컬 시스템, 다른 프로젝트 (예 : 프로젝트 B), git fetch은 출력을 제공하지 않습니다. 나는 그것이 어느 시점에서 바뀌 었다고 생각하지만, 그 원인이 무엇인지 알 수는 없다.

프로젝트 B, git fetch 출력 :

$ git checkout develop 
Switched to branch 'develop' 
Your branch is up-to-date with 'origin/develop'. 
$ git fetch -pv 
From BBB 
= [up to date]  develop      -> origin/develop 
$ git status 
On branch develop 
Your branch is behind 'origin/develop' by 2 commits, and can be fast-forwarded. 
    (use "git pull" to update your local branch) 

을 투사 설정 :

[core] 
    repositoryformatversion = 0 
    filemode = true 
    bare = false 
    logallrefupdates = true 
    precomposeunicode = true 
[remote "origin"] 
    url = AAA 
    fetch = +refs/heads/*:refs/remotes/origin/* 
[branch "master"] 
    remote = origin 
    merge = refs/heads/master 
[branch "develop"] 
    remote = origin 
    merge = refs/heads/develop 

$ git branch -vv 
* develop a061e40 [origin/develop: behind 1] 

가 프로젝트 B의 설정 :

[core] 
    repositoryformatversion = 0 
    filemode = true 
    bare = false 
    logallrefupdates = true 
    precomposeunicode = true 
[remote "origin"] 
    url = BBB 
    fetch = +refs/heads/*:refs/remotes/origin/* 
[branch "master"] 
    remote = origin 
    merge = refs/heads/master 
[branch "develop"] 
    remote = origin 
    merge = refs/heads/develop 

$ git branch -vv 
* develop      7d1afd6 [origin/develop: behind 2] 

는 어떻게 B 프로젝트에 git fetch의 동작을 변경할 수 있습니다 다시 프로젝트 A에서 어떻게 작동합니까?

답변

1

현재 개발중인 지점 커밋 ID를 .git\refs\remotes\origin\develop으로 확인할 수 있습니다.

두 커밋이 같으면 로컬 개발 지점이 실제로 최신 상태임을 나타냅니다.

두 커밋이 다른 경우 을 사용하여 developorigin/develop이 동일한 커밋 ID를 가리키는 지 확인할 수 있습니다. 또는 git branch -D developgit checkout develop을 사용한 다음 원격 저장소를 변경하고 git fetch을 다시 수행 할 수 있습니다.

+0

Sry가 너무 늦게 와서, 우선 순위에 의해 조금 뒤로 밀려났다. 로컬'develop' 브랜치를 삭제하고 다시 체크 아웃하면 문제가 해결되었습니다. 제안 해 주셔서 감사합니다! 나는 아직도 문제가 무엇인지 몰랐다. – Risadinha

+0

정상적으로 작동 할 수 있다면 이전에 우연히 리모콘에서 가져온 것이 주로 발생합니다. –

+0

"우연히 가져 왔습니다"? 그게 무슨 뜻 이니? – Risadinha