Git - push.default "matching"과 "simple"의 차이점은 무엇입니까?
저는 한동안 git를 사용해 왔지만, 직접 새로운 원격 저장소를 설정할 필요가 없었고 그렇게 하는 것이 궁금했습니다.저는 튜토리얼을 읽고 있는데 어떻게 "git push"를 작동시킬 수 있는지 혼란스럽습니다.
단순히 사용하는 경우git push가리키는 기본 분기(?)를 확인하라는 메시지가 표시됩니까?이 두 가지 옵션의 차이점은 무엇입니까?
git config --global push.default matching
git config --global push.default simple
일치는 로컬 레포에 있는 모든 분기를 푸시하고, 일치하지 않으면 수동으로 새 로컬 브랜치를 푸시하라고 말해야 합니다. 그렇죠?이 방법은 사용하기에 가장 좋은 방법입니까? 아니면 단순한 방법입니까?
git push는 이 단일 수 있습니다. 이 경우에는 다음과 같은 작업을 수행할 수 있습니다.
모든 분기 푸시
git config --global push.default matching
그러면 모든 분기가 원격 분기로 푸시되고 병합됩니다.모든 분기를 푸시하지 않으려면 이름을 완전히 지정하면 현재 분기를 푸시할 수 있지만 이는 다음과 크게 다르지 않습니다.default.
이름이 지정된 업스트림이 동일한 경우 현재 분기만 푸시
git config --global push.default simple
따라서, 제 생각에는 이 옵션을 사용하고 코드 분기를 분기별로 푸시하는 것이 좋습니다.가지는 수동으로 개별적으로 밀어주는 것이 좋습니다.
GIT 문서에서:깃닥스
아래는 전체 정보를 제공합니다. 대컨요,simple단지 밀어내기만 할 것입니다.current working branch리모컨에 동일한 이름이 있는 경우에만 가능합니다.이며 이설정은초매좋설기됩이니다본값며이정은의 이 될 입니다.GIT 2.0
에 반에면.matching원격에서 이름이 같은 모든 분기를 로컬로 푸시합니다.(현재 작업 중인 지점과 관계없이).이는 공유하고 싶지 않을 수도 있는 분기를 포함하여 잠재적으로 많은 다른 분기가 푸시된다는 것을 의미합니다.
옵션을 합니다: 개적으로사때일사다옵용다니합션을른로으반적인.current(변경 사항이 있으면 항상 분기하기 때문에) 현재 작동 중인 분기를 푸시합니다.하지만 초보자들에게는simple
push.default
지정되지 않은 해야 할 합니다. refspec은 git push입니다.다른 값은 특정 워크플로우에 적합합니다. 예를 들어 순수하게 중앙 워크플로우(즉, 가져오기 소스가 푸시 대상과 동일)에서는 업스트림이 아마도 사용자가 원하는 것입니다.가능한 값은 다음과 같습니다.nothing - do not push anything (error out) unless a refspec is explicitly given. This is primarily meant for people who want to avoid mistakes by always being explicit.
current - push the current branch to update a branch with the same name on the receiving end. Works in both central and non-central workflows.
upstream - push the current branch back to the branch whose changes are usually integrated into the current branch (which is called @{upstream}). This mode only makes sense if you are pushing to the same repository you would normally pull from (i.e. central workflow).
simple - in centralized workflow, work like upstream with an added safety to refuse to push if the upstream branch's name is different from the local one.
When pushing to a remote that is different from the remote you normally pull from, work as current. This is the safest option and is suited for beginners.
This mode will become the default in Git 2.0.
matching - push all branches having the same name on both ends. This makes the repository you are pushing to remember the set of branches that will be pushed out (e.g. if you always push maint and master there and no other branches, the repository you push to will have these two branches, and your local maint and master will be pushed there).
To use this mode effectively, you have to make sure all the branches you would push out are ready to be pushed out before running git push, as the whole point of this mode is to allow you to push all of the branches in one go. If you usually finish work on only one branch and push out the result, while other branches are unfinished, this mode is not for you. Also this mode is not suitable for pushing into a shared central repository, as other people may add new branches there, or update the tip of existing branches outside your control.
This is currently the default, but Git 2.0 will change the default to simple.
Git v2.0 Release Notes
Backward compatibility notes
언제git push [$there]무엇을 눌러야 하는지는 말하지 않습니다. 지금까지 전통적인 "filename" 의미를 사용했습니다(같은 이름의 브랜치가 이미 있는 한 모든 브랜치가 원격으로 전송되었습니다).Git 2.0에서 기본값은 "단순" 의미론이며, 이는 다음을 수행합니다.
동일한 이름을 가진 분기에 대한 현재 분기만, 그리고 현재 분기가 해당 원격 분기와 통합되도록 설정된 경우에만, 가져오기 위치와 동일한 원격으로 푸시됩니다. 또는
일반적으로 가져오는 위치가 아닌 원격으로 푸시하는 경우 동일한 이름을 가진 분기에 대한 현재 분기만 표시됩니다.
구성 변수 "push.default"를 사용하여 이를 변경할 수 있습니다."일치" 의미론을 계속 사용하려는 오래된 사용자인 경우 변수를 예를 들어 "일치"로 설정할 수 있습니다.다른 가능성에 대해서는 설명서를 참조하십시오.
때git add -u그리고.git add -A하여 행에서추경내실며되행디에않서다렉, 이은전트작유니합지여동다하서같을일에성음과명리은관체들령과 일관성을 유지합니다.git commit -a및 기타 명령(이 명령은 현재 하위 디렉터리에서만 작동하는 데 사용됨).말합니다git add -u .또는git add -A .작업을 현재 디렉터리로 제한하려는 경우.
git add <path>는 와동합다니와 .git add -A <path> 자, 서래그.git add dir/디렉토리에서 제거한 경로를 인식하고 제거 내용을 기록합니다.에서는 Git의이전버는서전에▁in는▁g.git add <path>제거를 무시하는 데 사용됩니다.라고 할 수 있습니다.git add --ignore-removal <path> 는가수경추에서 추가되거나 합니다.<path>당신이 정말 원한다면요.
언급URL : https://stackoverflow.com/questions/21839651/git-what-is-the-difference-between-push-default-matching-and-simple
'programing' 카테고리의 다른 글
| 내보낸 Firebase 메시징 서비스 구현에 대한 안드로이드 린트 불만을 해결하는 방법은 무엇입니까? (0) | 2023.06.26 |
|---|---|
| Mongoids는 무서운 URL로 이어집니다. (0) | 2023.06.26 |
| 특정 NA 열이 포함된 행 생략 (0) | 2023.06.26 |
| Angular 2에서 JSON을 게시하려면 어떻게 해야 합니까? (0) | 2023.06.26 |
| HttpContext는 왜입니까?현재 null? (0) | 2023.06.26 |