반응형
git push -u origin main
이런 커맨드를 보신 적이 있으실겁니다.
근데! -u 를 넣지 않아도 잘 작동합니다. -u는 대체 뭘까!? 라고 생각하신 분들을 위한 글!!
저는 보통 git push origin main 만을 사용했습니다.
하지만 -u 라는 옵션을 붙이게 된다면?
디폴트로 main 으로 푸쉬를 할 수 있게 해줍니다.
예를 들어,
한 번 git push -u origin spoonme 라고 했다고 합시다!!
그러면 앞으로는 자동으로 spoonme가 원격저장소로 등록이 되어 git push 만을 입력하더라도 spoonme 라는 브랜치로 푸쉬가 됩니다.
(pull 도 동일합니다.)
반응형