임시로 사용하던 내 github의 프로젝트 저장소를 회사 계정의 github 저장소로 옮겨야했다. 즉, 저장소도 바뀌었고 계정도 바뀌었다.
따라서 저장소를 옮기기 위해서는 두가지를 해주어야 한다.
1. 새로운 계정 설정하기 (Personal access tokens 또는 SSH Key)
- Personal access tokens : Settings > Developer settings > Personal access tokens
- SSH Key 생성은 아래 링크에서 확인
Mac에서 github SSH Key 생성 및 설정하기
android studio에서 https가 아닌 ssh 형태의 github repository에 접근하려면 사용하고 있는 pc의 SSH key가 github에 등록되어 있어야 한다. 키 생성하기 터미널을 열고, $ ssh-keygen Enter (그냥 편하게) Ente..
shary1012.tistory.com
2. 저장소 옮기기
git 명령어는 아래와 같다.
$ git clone --mirror {old repository}
$ cd {old repository name}
$ git remote set-url origin {new repository}
$ git push --mirror
[예시]
$ git clone --mirror https://github.com/your/old_sample.git
$ cd old_sample.git
$ git remote set-url origin https://github.com/your/new_sample.git
$ git push --mirror
'git' 카테고리의 다른 글
Git Error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400 (0) | 2024.12.24 |
---|---|
Mac에서 github SSH Key 생성 및 설정하기 (0) | 2022.01.19 |
git clone branch (브랜치 이름으로 내려받기) (0) | 2021.01.26 |
.gitignore가 제대로 관리되지 않을 때 (0) | 2020.08.08 |
git denyCurrentBranch 에러 (0) | 2020.06.24 |