• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28

ハマったので覚えるために記事にしました。

サーバ等で

   1  $ mkdir repo.git
   2  $ cd repo.git
   3  $ sudo git init --bare --shared=true

"空"の共有リポジトリができました。

ローカルマシンで

その後、remote add, add, commit, push

   1  git init
   2  git remote add origin ssh://git.s21g.com/mnt/git/repo.git 
   3  git add .
   4  git commit -m "initial import"
   5  git push origin master

サーバのrepo.gitにファイルが追加された時点でcloneできるようになります。空のリポジトリをcloneしようとしてもエラーが出ます:

   1  $ git clone ssh://git.s21g.com/mnt/git/repo.git 
   2  fatal: no matching remote head

おまけ:git URLを確認する git remote show origin

   1  git remote show origin
   2  * remote origin
   3    URL: ssh://git.s21g.com/mnt/git/repo.git

posted by Png satoko on Thu 19 Feb 2009 at 14:21

Comments:

or Preview
Social Bookmarks
  • Delicious
  • B_entry1312
  • Clip_16_12_w
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ