답변:
git remote add 이름 URLgit push 이름 지점예:
git remote add origin git@github.com:foo/bar.git
git push origin master
의 문서를 참조하십시오 git push- 원격 주어진 지점에 대한 기본값으로 원격을 설정할 수 있습니다; 그렇지 않으면 이름 origin이 특별합니다. 그냥 git push단독으로 동일한 작업을 수행합니다 git push origin thisbranch (어떤 지점 당신이있어 용).
git init --bare /foo/bar.git만든 다음 로컬 응답을 밀어 넣으면 충분합니다 (이 답변과 같이). 압축 / 타킹 된 것을 서버로 전송할 필요는 없습니다.
로컬 컴퓨터에서 먼저 저장소를 복제하십시오.
git clone --bare /path/to/repo /path/to/bare/repo.git # don't forget the .git!
이제 tar / gzip 또는 원하는 아카이브 도구를 사용하여 새 repo.git 디렉토리를 아카이브 한 다음 아카이브를 서버에 복사하십시오.
서버에서 저장소를 아카이브 해제하십시오. 그런 다음 로컬 저장소에 원격을 설정해야합니다.
git remote add repo-name user@host:/path/to/repo.git #this assumes you're using SSH
그러면 다음을 사용하여 원격 리포지토리로 밀고 당길 수 있습니다.
git push repo-name branch-name
git pull repo-name branch-name
remote server> cd /home/ec2-user
remote server> git init --bare --shared test
add ssh pub key to remote server
local> git remote add aws ssh://ec2-user@<hostorip>:/home/ec2-user/dev/test
local> git push aws master
git push -u --all우리는 생략 할 수origin는 기본 밀고에 대한 이름을 가정이고로-u도 원격 지점을 추적합니다.