git push -u가 무슨 뜻입니까?
저는 두 가지 다른 버전의 깃이 있습니다.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
논박 없이이 기사는 이 개념을 설명하고 설명합니다.
새 분기를 처음으로 푸시할 때는 다음을 사용합니다.
git push -u origin <branch>
그런 다음 더 짧은 명령을 입력하면 됩니다.
git push
처음으로-u
옵션을 사용하여 로컬 분기에 영구 업스트림 추적 분기를 만들었습니다.
더 이상 최신 버전이 아닙니다!
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.
-u 옵션은 다음 작업을 수행합니다.최신 상태이거나 성공적으로 푸시된 모든 분기에 대해 인수 없는 git-pull 및 기타 명령에 사용되는 업스트림(추적) 참조를 추가합니다.따라서 -u 옵션으로 로컬 브랜치를 푸시한 후 이 로컬 브랜치는 원격 브랜치와 자동으로 연결되며 git pull을 인수 없이 사용할 수 있습니다.
언급URL : https://stackoverflow.com/questions/5561295/what-does-git-push-u-mean
'programing' 카테고리의 다른 글
Git Bash가 내 경로를 보지 못합니다. (0) | 2023.05.19 |
---|---|
마지막 마이그레이션을 되돌리는 방법은 무엇입니까? (0) | 2023.05.19 |
C# 또는 VB 설명서 주석에 굵은 글씨 또는 기울임꼴로 표시됩니까? (0) | 2023.05.19 |
변수 워크북 / 워크시트 vba 선언 (0) | 2023.05.19 |
HEAD를 이전 위치로 다시 이동하려면 어떻게 해야 합니까?(헤드 분리) & 커밋 실행 취소 (0) | 2023.05.14 |