본문 바로가기

Git/Git & Git Hub

remote 변경 (git remote 변경)

# Git Remote 변경

1. 기존 repo 깔끔하게 정리 pull/push

git pull
git add .
git commit -m "clean push"
git push

2. 기존 repo remote 제거

git remote remove kim

git remote remove origin

git push origin {branch_name}

ex) git push origin master

3. 새 repo remote 추가

git remote add origin https://github.com/계정/리포지토리

https://github.com/Nanninggu/tcp_ip_test_server.git

 

맨날 까먹네

 

까먹지 말자. ???

 

까먹어도 된다 = 정리만 잘해놓자. ㅇ_ㅇ;;

 

추가, 브랜치 만드는법 매우 간단

1. git branch 명렁어로 현재 생성된 브랜치 확인

2. 브랜치 생성 git branch {branch_name} → 해당 이름으로 생성됨.

3. 생성한 브랜치로의 전환 git checkout {branch_name} → 바로 위에서 신규로 생성한 branch로 전환한다.

(2번의 브랜치 이름과 동일 해야한다.)

4. git push origin {branch_name} 을 통해 해당 브랜치로 업로드.

- 원격 저장소에 반영됨.

- 2,3의 브랜치이름과 동일해야 한다.

참고, 위의 1번과2번을 동시에 진행 : git checkout -b {branch_name}

 

- 끝 -