여러개 원격저장소(remote repository) 하나의 VSCode 폴더에서 연결해 관리하기

namuJun·2024년 2월 15일
0

VSCode

목록 보기
1/1
post-thumbnail

하나의 organization에 있는 여러 repository를 하나의 VSCode 창에서 관리하고자 해서 방법을 찾았다.
단, 하나의 repo만 쓸때보다 사용 가능한 기능이 한정적이니 참고하여 이용하도록 하자.

  1. VSCode 에서 새로운 폴더를 열고 첫번째 repo를 clone 해온다.

    git clone [github repo link]

    git clone https://github.com/Dementia-Diagnosis-Project/memoria_AI.git
  2. 해당 폴더(repo)로 이동 후, remote 설정해준다.

    cd [폴더명]

    cd memoria_AI

    git remote add [지정할 remote명] [github repo link]

    git remote add altai https://sw930718@github.com/Dementia-Diagnosis-Project/memoria_AI.git
  3. 상위 경로로 나온 후, 위 작업을 반복한다.

    cd ..
    git clone https://github.com/Dementia-Diagnosis-Project/memoria_WEB.git
    cd memoria_WEB
    git remote add altweb https://sw930718@github.com/Dementia-Diagnosis-Project/memoria_WEB.git
  4. 파일 추가 or 수정 후, 정상적으로 push 되는지 확인한다.
    VSCode 기준 원래 push 하던 소스제어 부분이 활성화 되어서 정상 동작하나 확인했으나 commit만 되고 push는 되지X
    terminal에서 코드로 push 해줘야 함

    a. VSCode로 commit 하기

    b. Terminal로 commit 하기

    git add .

    git commit -m [commit 메세지]

    git commit -m "[modify] test file"

    c. 공통 작업
    git push [remote명] [branch명]

    git push altweb master
  5. 정상 push 확인! 완료!


[완료 이미지] 하나의 경로에 두 repo 를 올린 모습


참고

profile
💡 DS/ML/DL 공부중. Done is better than perfect.

0개의 댓글