git

[Git] git push 오류 "warning: push.default is unset;"

rachel_13 2023. 2. 4. 21:55
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

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)

 

"push.default" 설정은 원격 저장소로 변경 사항을 푸시할 때 "git push" 명령어의 동작 방식을 결정한다.

 

 

(1) matching

git config --global push.default matching

 

기본값이 변경된 후에도 현재 동작을 유지한다.

'matching'옵션은 local과 remote 저장소의 동일 이름을 가진 모든 브랜치들을 푸시하라고 Git에게 알린다.

Git 2.0버전부터 기본값이다.

 

(2) simple

git config --global push.default simple

명령어를 입력하면 즉시 새 동작을 적용한다.

"simple" 옵션은 Git에게 local과 동일한 이름을 가진 remote 브랜치로 푸시하라는 것을 알립니다.

이 값은 다른 옵션보다 안정적이며, 실수로 관련없는 브랜치로의 푸시를 방지합니다.