github にプロジェクトを登録したのでそのときの備忘録です。
まずは github にログインしたあと、dashboard にいきます。(http://github.com にいくんだけどね。)
と右側のペインに Your Repositories と書いてある横に Create a New Repository というリンクがあるのでクリック。
Project Name/Description/Homepage URL を入力するフォームが現れるので適宜入力。
Who has access to this repository? とありますが、ここは Anyone にしました。無料のプランでは private なプロジェクトは作成できないみたいです。ぼくは CPAN モジュールをここにおくつもりだったので、private にする意味は全くないので、Anyone です。
そして、Create Repository ボタンを押して submit します。
そうするとプロジェクトのページができます。
http://github.com/アカウント名/プロジェクト名/tree/master
例:http://github.com/comewalk/perl-xrds-simple/tree/master
そしたら親切なガイドラインが出てきましたよ。
Global setup:
Download and install Git
git config --global user.name "Takatsugu Shigeta"
git config --global user.email [email protected]
Add your public keyNext steps:
mkdir perl-xrds-simple
cd perl-xrds-simple
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin [email protected]:comewalk/perl-xrds-simple.git
git push origin masterExisting Git Repo?
cd existing_git_repo
git remote add origin [email protected]:comewalk/perl-xrds-simple.git
git push origin masterImporting a SVN Repo?
Click hereWhen you're done:
Continue
上記に従ってローカルの設定をしました。今回は初めて github に登録するということと新規に作成するプロジェクトでしたので、Global setup と Next steps を実践しました。各 OS 毎の ssh キーの作成、登録についても github のヘルプページにありました。すばらしい。
かくして touch しただけの空っぽの README ファイルが github に登録されました。
さてこれから新しく作成したプロジェクトのファイル群を git add して、git commit して、git remote add して、git push するというわけですね。
で、今回作成したプロジェクトは perl-xrds-simple です。ご興味のある方はご覧ください。
以下はローカル作業のメモです。 もともと $MY_PROJECTS/XRDS-Simple/ というディレクトリで作成していました。そこから github へ登録するまでのメモとなります。
# cd perl-xrds-simple
# cp -prv $MY_PROJECTS/XRDS-Simple/* .
# git add Changes MANIFEST MANIFEST.SKIP Makefile.PL README examples/ lib/ t/ xt/
# git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD..." to unstage)
# new file: Changes
# new file: MANIFEST
# new file: MANIFEST.SKIP
# new file: Makefile.PL
# modified: README
# new file: examples/bench_parser.t
# new file: examples/client.t
# new file: examples/parse.t
# new file: examples/partuza.pl
# new file: lib/XRDS/Simple.pm
# new file: t/00_compile.t
# new file: t/01_discovery.t
# new file: t/02_fetch.t
# new file: t/03_parse.t
# new file: t/04_process.t
# new file: t/examples/fireeagle.yahoo.xrds
# new file: t/examples/google.openid.xrds
# new file: t/examples/meta.html
# new file: t/examples/opensocial.sample.xrds
# new file: t/examples/partuza.xrds
# new file: t/examples/xrds.xml
# new file: t/examples/yahoo.openid.xrds
# new file: xt/perlcritic.t
# new file: xt/pod.t
# new file: xt/podcoverage.t
# new file: xt/podspell.t
# new file: xt/synopsis.t
example/partuza.pl は不要だったので以下を実施。
#git rm example/partuza.pl
example/bench_parser.t を微調整したので、
# Changed but not updated:
# (use "git add/rm..." to update what will be committed)
# modified: examples/bench_parser.t
そこで以下を実施
# git add example/bench_parser.t
そしてコミット
# git commit -m 'initial commit'
Created commit bd5af25: initial commit
26 files changed, 724 insertions(+), 0 deletions(-)
create mode 100644 Changes
create mode 100644 MANIFEST
create mode 100644 MANIFEST.SKIP
create mode 100644 Makefile.PL
create mode 100644 examples/bench_parser.t
create mode 100644 examples/client.t
create mode 100644 examples/parse.t
create mode 100644 lib/XRDS/Simple.pm
create mode 100644 t/00_compile.t
create mode 100644 t/01_discovery.t
create mode 100644 t/02_fetch.t
create mode 100644 t/03_parse.t
create mode 100644 t/04_process.t
create mode 100644 t/examples/fireeagle.yahoo.xrds
create mode 100644 t/examples/google.openid.xrds
create mode 100644 t/examples/meta.html
create mode 100644 t/examples/opensocial.sample.xrds
create mode 100644 t/examples/partuza.xrds
create mode 100644 t/examples/xrds.xml
create mode 100644 t/examples/yahoo.openid.xrds
create mode 100644 xt/perlcritic.t
create mode 100644 xt/pod.t
create mode 100644 xt/podcoverage.t
create mode 100644 xt/podspell.t
create mode 100644 xt/synopsis.t
そして、git remote はすでに最初に作ったのでエラーになる。
# git remote add origin [email protected]:comewalk/perl-xrds-simple.git
fatal: remote origin already exists.
最後に push
# git push origin master
Enter passphrase for key '/hogehoge/.ssh/id_rsa':
Counting objects: 39, done.
Compressing objects: 100% (35/35), done.
Writing objects: 100% (37/37), 8.80 KiB, done.
Total 37 (delta 4), reused 0 (delta 0)
To [email protected]:comewalk/perl-xrds-simple.git
d667fa9..6b6b424 master -> master
これで github に登録されました。
Comments