「git」タグアーカイブ

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

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

リモートサーバ上にレポジトリディレクトリを作成して移動します。
[bash]
cd [ProjectsDir]/Repository
[/bash]
空のレポジトリを生成。
[bash]
git –bare init –share
[/bash]

開発環境で、
[bash]
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
[/bash]

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