카테고리 없음

Git 원격 저장소 주소 변경하는 방법

cocochanel 2023. 1. 29. 16:37
이슈 상황

 

프로젝트의 원격 저장소가 A에서 B로 변경되었다.

이에 따라, 원격 저장소 주소를 변경 적용하고자 한다.

 

해결 방법

 

1. 프로젝트가 위치한 폴더를 열고, 우클릭 하여 'Git Bash Here' 버튼을 누른다.

 

 
 
2. 아래 명령어를 순서대로 입력한다.
 
$ git pull
$ git add --all
warning: in the working copy of '.project', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'bin/log4j2.xml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'logfile.log', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/log4j2.xml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/main/MainJob.java', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/util/RDaoArgos.java', LF will be replaced by CRLF the next time Git touches t
$ git commit -m "init"
On branch master
nothing to commit, working tree clean
$ git remote remove origin
$ git remote add origin [ Git Clone URL 붙여넣기 ]
$ git push origin master
Enumerating objects: 27, done.
Counting objects: 100% (27/27), done.
Delta compression using up to 12 threads
Compressing objects: 100% (21/21), done.
Writing objects: 100% (27/27), 5.94 MiB | 9.30 MiB/s, done.
Total 27 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), done.
To [ Git Clone URL ]
 * [new branch]      master -> master