어떤 브랜치와 병합하길 원하는지 알려주지 말고
TL; DR : 뽑을 수없는 "추적 된"지점이 있습니다.
그래서 여기 "버킷 -4"가 있습니다 :
$ git branch -v
bucket-1 410f7b5 * gh-53 * gh-48 * "Share App"
bucket-2 7ed70a2 * upgrade to SOLR 3.3.0
bucket-3 400ffe4 * emergency fix prod issue
* bucket-4 64c2414 Merge branch 'bucket-3' into bucket-4
master 8dc4854 [ahead 1] * gh-73
리모컨에서 변경 사항을 가져오고 싶습니다.
$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.bucket-4.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
If you often merge with the same branch, you may want to
use something like the following in your configuration file:
[branch "bucket-4"]
remote = <nickname>
merge = <remote-ref>
[remote "<nickname>"]
url = <url>
fetch = <refspec>
See git-config(1) for details.
흠, 나는 이미 "버킷 -4"를 추적 지점으로 추가했다고 생각했다. 보자 :
$ git remote show origin
* remote origin
Fetch URL: git@github.com:abcd/main.git
Push URL: git@github.com:abcd/main.git
HEAD branch (remote HEAD is ambiguous, may be one of the following):
bucket-3
master
Remote branches:
bucket-1 tracked
bucket-2 tracked
bucket-3 tracked
bucket-4 tracked
master tracked
Local branches configured for 'git pull':
bucket-1 merges with remote bucket-1
bucket-2 merges with remote bucket-2
bucket-3 merges with remote bucket-3
master merges with remote master
Local refs configured for 'git push':
bucket-1 pushes to bucket-1 (up to date)
bucket-2 pushes to bucket-2 (up to date)
bucket-3 pushes to bucket-3 (up to date)
bucket-4 pushes to bucket-4 (local out of date)
master pushes to master (fast-forwardable)
실제로 bucket-4는 "추적 됨"으로 표시되어 있지만 어떻게 든 푸시로 구성되었지만 풀은 아닙니다.
내 .git/config
파일을 살펴보면 대부분의 분기에 대해 "원격"및 "병합"항목이 있지만 bucket-4에는 없습니다. 이것이 없으면 어떻게 "추적"된 것으로 간주됩니까?
[remote "origin"]
url = git@github.com:abcd/main.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "rel-2011-07-07"]
remote = origin
merge = refs/heads/rel-2011-07-07
[branch "bucket-1"]
remote = origin
merge = refs/heads/bucket-1
[branch "bucket-2"]
remote = origin
merge = refs/heads/bucket-2
[branch]
autosetupmerge = true
[branch "bucket-3"]
remote = origin
merge = refs/heads/bucket-3
I see that the likely solution here is to add remote/merge
entries for bucket-4 in my config file. But how is it considered "tracked" without this? bucket-4 was created locally, then pushed to the server from this repo, so I suspect that somehow I didn't set up tracking properly for this branch.
Is there some configuration I can add in order to make all local branches track their remotes properly in the future?
It says bucket-4 pushes to bucket-4
just because the default when pushing a branch is to push it to one with a matching name on the remote. (Note that this is still the default, even if the local branch is tracking a remote-tracking branch and the remote-tracking branch corresponds to a branch with a different name in the remote repository.)
The simplest way to set up the association between your bucket-4
and bucket-4
in origin
is to make sure that the next time you push, you do:
git push -u origin bucket-4
Alternatively, you can do:
git branch --set-upstream-to origin/bucket-4
To answer a couple of your questions directly:
How is it even considered "tracked" without this?
In this case it isn't - it's not tracking the remote-tracking branch in any sense if there's no branch.bucket-4.merge
or branch.bucket-4.remote
in your git config. The output from git remote show origin
is just showing you where the branch would be pushed by default.
Is there some configuration I can add in order to make all local branches track their remotes properly in the future?
I don't think that there is. When you created bucket-4
locally, as I assume happened, the remote-tracking branch didn't exist, so it can't be set up at that point - it would be very confusing default behaviour. You just need to remember to add -u
to your first git push
of that branch to its upstream repository.
I hope that's of some help.
git branch --set-upstream <branch> origin/<branch>
was deprecated at least as of 1.8.2.3 (my version).
Use git branch --set-upstream-to=origin/<branch> <branch>
instead.
'Programing' 카테고리의 다른 글
값이 없으면 URL 쿼리 매개 변수가 유효합니까? (0) | 2020.07.10 |
---|---|
주석 @GetMapping과 @RequestMapping의 차이점 (method = RequestMethod.GET) (0) | 2020.07.10 |
XML 사이트 맵에 어떤 콘텐츠 유형 값을 보내야합니까? (0) | 2020.07.10 |
다른 어셈블리에서 두 개의 부분 클래스를 사용하여 동일한 클래스를 나타낼 수 있습니까? (0) | 2020.07.10 |
lodash에서 include 메소드를 사용하여 오브젝트가 콜렉션에 있는지 확인하려면 어떻게해야합니까? (0) | 2020.07.10 |