ybase

cakephpのインストール完了

installCakephpをmasterにマージ
  • マージはコミットも同時に行われる
  • pushでgithubに反映
    • コミットログには何も書かれてないが、ブランチinstallCakephpの結果がmasterにマージされてるのを確認
  • ブランチinstallCakephpを消したがgithubに反映されるのはどのタイミングか?
$ git checkout master
Switched to branch 'master'

$ git merge installCakephp
Updating 11b70d2..b5aeaa5
Checking out files: 100% (747/747), done.
Fast-forward
 .htaccess                                          |    5 +
...

$ git push origin master
Total 0 (delta 0), reused 0 (delta 0)
To git@github.com:iphlox/ybase.git
   11b70d2..b5aeaa5  master -> master

$ git branch -d installCakephp
Deleted branch installCakephp (was b5aeaa5).

smarty2.6.26とsmartyview090818

ブランチinstallSmartyを作って作業する
smarty2.6.26をDLしてきてインストール
  • 展開したSmarty-2.6.26/libsをvendors/smartyに移動する
$ git checkout -b installSmarty
Switched to a new branch 'installSmarty'

$ pwd
/Applications/MAMP/htdocs/ybase

$ ls
README			cake			web
Smarty-2.6.26.zip	plugins
app			vendors

$ unzip Smarty-2.6.26.zip 
Archive:  Smarty-2.6.26.zip
...

$ mv Smarty-2.6.26/libs vendors/smarty
クローンで取得、設定する
  • git://github.com/kaz29/smartyview.gitでクローンできた
$ cd app/plugins/

$ pwd
/Applications/MAMP/htdocs/ybase/app/plugins

$ git clone git@github.com:kaz29/smartyview.git smarty
Initialized empty Git repository in /Applications/MAMP/htdocs/ybase/app/plugins/smarty/.git/
ERROR: Permission to kaz29/smartyview denied to iphlox.
fatal: The remote end hung up unexpectedly

$ git clone git://github.com/kaz29/smartyview.git smarty
Initialized empty Git repository in /Applications/MAMP/htdocs/ybase/app/plugins/smarty/.git/
remote: Counting objects: 76, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 76 (delta 15), reused 0 (delta 0)
Receiving objects: 100% (76/76), 17.36 KiB, done.
Resolving deltas: 100% (15/15), done.

$ cd ..
$ pwd
/Applications/MAMP/htdocs/ybase/app
 
$ mkdir -p tmp/smarty/templates_c
$ chmod go+w tmp/smarty/templates_c

$ mkdir -p tmp/smarty/cache
$ chmod go+w tmp/smarty/cache
pushしたらapp/plugins/smartyがリンクになった?
  • app/tmp/smartyは管理外
  • クローンで取ってきたapp/plugins/smartyはパーミションがおかしい?
  • git commit --amendで最後のコミットを修正できる
$ git add app/plugins/smarty
$ git add app/tmp/smarty
$ git add vendors/smarty
$ git rm -rf app/tmp/smarty

$ git commit
[installSmarty 8b294b1] smarty2.6.26+smartyview090818を設置
 72 files changed, 9816 insertions(+), 0 deletions(-)
 create mode 160000 app/plugins/smarty
 create mode 100644 vendors/smarty/Config_File.class.php
...

$ git push origin installSmarty
Counting objects: 83, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (79/79), done.
Writing objects: 100% (79/79), 85.15 KiB, done.
Total 79 (delta 13), reused 0 (delta 0)
To git@github.com:iphlox/ybase.git
 * [new branch]      installSmarty -> installSmarty

使えるgitコマンド

ブランチ指定でクローンするには
  • git clone -b installSmarty git@github.com:iphlox/ybase.git