Git – setting up a remote repository and doing an initial push
git remote add with other ssh port
아래와 같이 서버를 설정하고
1 2 3 4 5 6 |
ssh git@example.com mkdir my_project.git cd my_project.git git init --bare git update-server-info # If planning to serve via HTTP exit |
아래와 같이 첫 push를 하면 된다.
1 2 3 4 5 6 |
cd my_project git init git add * git commit -m "My initial commit message" git remote add origin ssh://git@example.com:port/home/git/my_project.git git push -u origin master |
만약 설정된 remote repository를 지우고 싶다면 git remote rm origin 하면 된다.