Git에서 같은 코드를 다른 저장소로 제출

1843 단어 Git공구.
한 창고clone에서 내려온 후 기본값은origin입니다. 따라서 일반적으로 업데이트되고 전송되는 명령은 다음과 같습니다.
git pull origin master
git pull origin develop

git push origin master
git push origin develop
git remote add github http://xxxxxxxx.git   (   clone       ) 
git remote add gitlab http://xxxxxxxx.git; 

git push github master:master; 
git push gitlab master:cafe-pages;

현재 지점 아래의 코드를push에서 원격 지점 아래로 직접 이동할 수도 있습니다
git push gitlab develop

커밋 시 다음과 같은 오류가 발생할 수 있습니다.
$ git push -u coding develop
fatal: unable to access 'https://git.coding.net/liukang325/new_pro.git/': The requested URL returned error: 403

왜냐하면 두 창고의 사용자 이름이 일치하지 않을 수도 있기 때문이다.
해결 방법: 엽니다.git/config는
[remote "coding"]  
    url = https://github.com/iopqrst/liukang325/new_pro.git

다음으로 수정:
[remote "coding"]
url = https://liukang325@github.com/liukang325/new_pro.git

앞에서 나의git 제출에 필요한 사용자 이름liukang325를 추가합니다 @

좋은 웹페이지 즐겨찾기