「git」タグアーカイブ

gitでリモートサーバにpushする

gitでローカルリポジトリを使っていたプロジェクトを共有することになって、とりあえずリモートサーバにpushしようとしたところ、やり方が分からない!ってことで、とりあえず出来たからいいやレベルでやり方のメモです。

リモートサーバ上にレポジトリディレクトリを作成して移動します。

cd [ProjectsDir]/Repository

空のレポジトリを生成。

git --bare init --share

開発環境で、

git config --global user.email "user@mail.com"
git config --global user.name "TechGuy"

git remote add origin ssh://user@netanote.com/[ProjectsDir]/Repository

git push --set-upstream origin master

※一度はコミットしてあることが必要。