[Git] autoSetupRemote 설정하기.

HYUNGU, KANG·2022년 9월 10일
2

Git-CheatSheet

목록 보기
3/6

로컬에서 브랜치를 생성한뒤, 리모트에 푸시를 하려 할때 항상 다음과 같은 메세지를 만난다.

fatal: The current branch feat/branch-name has no upstream branch.
To push the current branch and set the remote as upstream, use git push --set-upstream origin feat/branch-name

항상 위에 나온 명령어를 복사 붙여넣기해서 실행한 뒤, push 하기 마련인데 최근에 새로운 옵션이 추가됐다.

Git 2.37.0 버전에서 새롭게 릴리즈된 옵션인 push.autoSetupRemote 옵션을 사용하면 더이상 번거롭지 않게 위의 명령어를 통해서 별도의 설정을 하지 않아도, 자동으로 리모트 업스트림 브랜치를 설정할 수 있다.

git config --global --add push.autoSetupRemote true

profile
JavaScript, TypeScript and React-Native

0개의 댓글