두 가지 버전의 자식이 있습니다. 1.6.2 버전에서는 옵션 git push
이 없습니다 -u
. 1.7.x 버전에서만 나타납니다.
문서에서는 -u
변수와 관련이 있습니다.
branch.<name>.merge
에서 git config
. 이 변수는 아래에 설명되어 있습니다.
Defines, together with branch.<name>.remote, the upstream branch
for the given branch. It tells git fetch/git pull which branch to merge.
업스트림 브랜치 란 무엇입니까?
답변
“업스트림”은 GitHub 리포지토리와 같은 다른 사람들이 가져올 주요 리포지토리를 나타냅니다. -u 옵션은 리포지토리를 중앙에 연결하여 업스트림을 자동으로 설정합니다. 그러면 앞으로 Git은 어디로 밀고 싶은지, 어디에서 끌어 올 것인지를 “알고”있으므로 인수를 사용 git pull
하거나 사용 git push
하지 않고 사용할 수 있습니다 . 이 기사 에서는이 개념을 약간 설명하고 설명합니다.
답변
더 이상 최신 상태가 아닙니다!
Push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.