본문 바로가기
카테고리 없음

[git] git push 수행시 push.default is unset 에러

by 왕 달팽이 2019. 2. 26.
반응형

Git push를 이용해서 리모트 리파지토리에 소스코드를 전송하려고 할 때 “warning: push.default is unset;” 으로 시작하는 경고 메시지가 출력되는 현상이 발생할 때가 있다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ git push
warning: 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.
 
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
cs


이 메시지의 의미는 git push 명령의 옵션을 확인해달라는 의미다. git의 push 명령에는 두 가지 옵션이 있다. 

  • simple : 현재 작업중인 브랜치만 push
  • matching : local과 remote 브랜치명이 동일한 모든 브랜치를 push


Simple의 경우 현재 checkout 해서 작업중인 브랜치의 내용만 push 한다는 의미고 matching은 리모트에 같은 이름이 있는 다른 브랜치들도 한꺼번에 push 하는 기능이다. 로컬에 있는 모든 브랜치를 리모트와 항상 동일하게 유지하고 싶을 때 사용된다.


설정 방법은 다음과 같다.


1
Git config —global push.default [simple or matching]                          
cs


참고로 git config —global 은 현재 접속중인 사용자의 기본 설정을 바꾸는 명령으로 ~/.gitconfig 파일을 수정한다. Git config —local 의 경우 현재 리파지토리의 설정값인 .git/config 파일을 고치는 것으로 현재 리파지토리만 영향을 받는다. Git config —system의 경우 /etc/gitconfig 파일을 고치는 것으로 시스템에 있는 전체 사용자에게 영향을 미치는 수정 방법이다.



반응형

댓글