본문 바로가기

Git

[Git] origin,remote 의미

origin 이란 원격 저장소의 이름, 별명(alias)이다

빨간 네모 박스 안이 원격저장소의 url이다.

 

원격저장소 추가 명령어는 git remote add, git clone 등이 있다.

  git remote add <이름> <url>
  
  //보통 origin으로 사용, 아래와 같이
  git remote add origin <url>

 

git remote add origin <url> 형식으로 원격저장소를 추가하거나 

git clone을 통해 원격저장소를 복사한다면 

 

자동으로 origin이라는 이름의 원격저장소가 등록되게 된다.

 

확인하려면 아래 명령어를 입력하면 된다.

 

git remote -v

 

 

다음과 같이 origin으로 되어있음을 확인할 수 있다.

 

 

remote 와 origin의 차이는

 

origin은 remote repository의 url를 대표하는 대명사,기본 별명(default alias)로 생각하면 될 것같다.

remote 는 remote repository를 참조해야할 때 사용하는 명령어다

 

 

 

*아래 블로그의 master 라는 branch의 기본값은 2020년 10월 기준으로 main으로 바뀌었다.

 

참고 블로그:

https://www.inflearn.com/questions/27696

 

Origin, Master, Head의 의미 - 인프런 | 질문 & 답변

Origin과 Master, Head 이 단어들의 차이점을 설명 부탁드려도 될까요? - 질문 & 답변 | 인프런...

www.inflearn.com

 

https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=hisukdory&logNo=220766885707 

 

[git] origin, remote, 그리고 branch 개념

SVN에서 GIT으로 넘어온지 좀 되었는데, GIT을 제대로 이해하기보다는 그냥 그때그때 검색해서 쓰...

blog.naver.com

https://stackoverflow.com/questions/9529497/what-is-origin-in-git

 

What is "origin" in Git?

When I run: git push origin branchname What exactly is origin and why do I have to type it before the branch name?

stackoverflow.com