ラベル git の投稿を表示しています。 すべての投稿を表示
ラベル git の投稿を表示しています。 すべての投稿を表示

git-flow 使用開始

2011年1月17日月曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

[前回] Cocoaの日々: git-flow をインストール

既存(といっても始めたばかりの)gitリポジトリに途中から git-flow を適用してみた。
$ cd project
$ git flow init
fatal: Working tree contains unstaged changes. Aborting.
変更途中のファイルが存在したので怒られた。すべてコミットして再び init を実行。
$ git flow init

Which branch should be used for bringing forth production releases?
   - master
Branch name for production releases: [master] 
Branch name for "next release" development: [develop] 

How to name your supporting branch prefixes?
Feature branches? [feature/] 
Release branches? [release/] 
Hotfix branches? [hotfix/] 
Support branches? [support/] 
Version tag prefix? [] 
$
ブランチを見ると develop と master が用意されていて、現在は developがチェックアウトされている。
$ git branch
* develop
  master
あとはこの develop で開発を進めていけばいい。git-flow については今後開発の節目節目でまた紹介したいと思う。


参考情報


A successful Git branching model を補助する git-flow を使ってみた - Twisted Mind
分かりやすくて参考になる。

- - - -
既存のリポジトリでも導入は難しくなさそうなので、良さそうなら他のプロジェクトにも導入して行きたい(というか、運用中のプロジェクトの方が git-flowの恩恵が受けられると思われる)。

git-flow をインストール

2011年1月16日日曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

[前回] Cocoaの日々: MacPorts と git インストール

git-flow をインストールした。

A successful Git branching model


"A successful Git branching model" とは Vincent Driessenが紹介している git を効果的に利用したソースコード管理モデルのこと。下記のサイトで公開されている。
上記は英語だが、@oshow さんが翻訳したものを公開している。
見えないチカラ: A successful Git branching model を翻訳しました

特徴的なのはブランチの使い方で、master, develop の2つのブランチを中心に、新機能開発用の feature、バグ修正用の hotfixes など用途に合わせたブランチの種類を定義している。これらのブランチの定義ならびに運用方法を定義したのがこのモデル。


git-flow


git-flow は "A successful Git branching model" を実践するのに便利なツール集。GitHubでソースが公開されている。
nvie/gitflow - GitHub

活用例がいろいろなサイトで紹介されているが下記が分かりやすくて参考になる。
A successful Git branching model を補助する git-flow を使ってみた - Twisted Mind

インストール方法は何種類かあるが今回は MacPorts を使った。
$ sudo port install git-flow
Password:
--->  Computing dependencies for git-flow
--->  Dependencies to be installed: getopt
--->  Fetching getopt
--->  Attempting to fetch getopt-1.1.4.tar.gz from http://distfiles.macports.org/getopt
--->  Verifying checksum(s) for getopt
--->  Extracting getopt
--->  Applying patches to getopt
--->  Configuring getopt
--->  Building getopt
--->  Staging getopt into destroot
--->  Installing getopt @1.1.4_1
--->  Activating getopt @1.1.4_1
--->  Cleaning getopt
--->  Fetching git-flow
--->  Verifying checksum(s) for git-flow
--->  Extracting git-flow
--->  Configuring git-flow
--->  Building git-flow
--->  Staging git-flow into destroot
--->  Installing git-flow @0.4_0
--->  Activating git-flow @0.4_0
--->  Cleaning git-flow
$
前回のハマりがウソのように今回は一発ですんなり入った。/opt/local/bin 配下に git-flow* ファイルがインストールされる。
$ cd /opt/local/bin
[bin]$ ls git-flow*
git-flow  
git-flow-init  
git-flow-version
git-flow-feature 
git-flow-release
git-flow-hotfix  
git-flow-support

- - - -
新規にとりかかっている iPadアプリ開発でこれを試してみる。

MacPorts と git インストール

2011年1月15日土曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

nvie/gitflow - GitHub を試そうと思ったところ MacPorts版があるようなので、良い機会なので MacPorts を MacBook Proへインストールすることにした。

MacPorts


公式ページから Snow Leopard 用のパッケージ(1.9.2) をダウンロードしてインストールした。
The MacPorts Project -- Home


git のインストール


以前、ソースコードからインストールしたが((旧) Cocoaの日々: github を使う)これを削除して MacPorts経由でインストールする。

[参考にしたページ] clmemo@aka: MacPorts で Snow Leopard に git をインストールした

$ sudo port install git-core
Password:<パスワード入力>
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
--->  Computing dependencies for git-core
--->  Dependencies to be installed: curl curl-ca-bundle perl5 perl5.8 libidn gettext expat libiconv gperf ncurses ncursesw openssl zlib pkgconfig p5-error python27 bzip2 db46 gdbm readline sqlite3 rsync popt
--->  Fetching perl5.8
   :
(以下、依存パッケージのインストールが続く)

環境によっては ncources 辺りでハマるらしいが素の MacBook Pro では特に問題は起きなかった。
MacPorts でgit をインストールするのが大変なわけ | ブログが続かないわけ

代わりに Xcode に関してエラー。インストール場所が標準と異なる為のようだ。
--->  Extracting zlib
Error: Couldn't find Xcode; expected it to be at /Developer/Developer Tools/
  Xcode and iOS SDK 3.2.5/Applications/Xcode.app.
Error: 
Error: If you have not installed Xcode, install it now; see:
Error: http://guide.macports.org/chunked/installing.xcode.html
Error: 
Error: If you have installed Xcode in a nonstandard location, inform MacPorts
Error: of that location by changing the 'developer_dir' variable in
Error: /opt/local/etc/macports/macports.conf
自分の環境では SDKを /Developer Tools/Xcode and iOS SDK 3.2.5 に入れてある。MacPorts は xcode-select というコマンドの結果を使っているらしい。これを見ると存在しないフォルダになっていた(近いのだが)。
$ xcode-select -print-path
/Developer/Developer Tools/Xcode and iOS SDK 3.2.5
これを次のように切り替える。
$ sudo xcode-select -switch /Developer\ Tools/Xcode\ and\ iOS\ SDK\ 3.2.5
[/]$ xcode-select -print-path
/Developer Tools/Xcode and iOS SDK 3.2.5
後々 Xcodeのバージョンが上がればまた同じ問題は出るのだが、とりあえず今回はこのまま進む。git-core のインストールを再開する。
sudo port install git-core
--->  Computing dependencies for git-core
--->  Dependencies to be installed: curl openssl zlib pkgconfig p5-error python27
 bzip2 db46 gdbm readline sqlite3 rsync popt
--->  Extracting zlib
  :
順調に進んだかと思ったが今度は db46 というとろろでエラー。
--->  Attempting to fetch bzip2-1.0.6.tar.gz from http://distfiles.macports.org/bzip2
--->  Fetching db46
--->  Attempting to fetch patch.4.6.21.1 from http://download.oracle.com/berkeley-db/patches/db/4.6.21/
--->  Attempting to fetch patch.4.6.21.2 from http://download.oracle.com/berkeley-db/patches/db/4.6.21/
--->  Attempting to fetch patch.4.6.21.3 from http://download.oracle.com/berkeley-db/patches/db/4.6.21/
--->  Attempting to fetch patch.4.6.21.4 from http://download.oracle.com/berkeley-db/patches/db/4.6.21/
--->  Attempting to fetch db-4.6.21.tar.gz from http://download-east.oracle.com/berkeley-db/
--->  Verifying checksum(s) for db46
--->  Extracting db46
--->  Applying patches to db46
--->  Configuring db46
Error: db46 requires the Java for Mac OS X development headers.
Error: Download the Java Developer Package from: 
Error: Target org.macports.configure returned: missing Java headers
Error: Failed to install db46
 :
Java用ヘッダファイルのインストールが必要とある(なんじゃそりゃ!)。ネットで情報を探すと同じ現象にあった人の記事が見つかった。

試験管のなかのコード :: MacPorts の "db46 requires the Java..." エラー

Java for Mac OS X 10.6 を入れないと駄目らしい。ADC Member サイト内の Downloads & ADC Program Assets - Java から下記の Java for Mac OS X 10.6 (10M330) をダウンロードしてインストールする。

インストール後、git-core のインストールを再開。
$ sudo port install git-corePassword:
--->  Computing dependencies for git-core
--->  Dependencies to be installed: python27 db46 gdbm readline sqlite3 rsync popt
--->  Configuring db46
--->  Building db46
  :
 :
--->  Fetching git-core
--->  Attempting to fetch git-1.7.3.5.tar.bz2 from http://distfiles.macports.org/git-core
--->  Attempting to fetch git-manpages-1.7.3.5.tar.bz2 from http://distfiles.macports.org/git-core
--->  Attempting to fetch git-htmldocs-1.7.3.5.tar.bz2 from http://distfiles.macports.org/git-core
--->  Verifying checksum(s) for git-core
--->  Extracting git-core
--->  Applying patches to git-core
--->  Configuring git-core
--->  Building git-core
--->  Staging git-core into destroot
--->  Installing git-core @1.7.3.5_0+doc+python27
--->  Activating git-core @1.7.3.5_0+doc+python27
--->  Cleaning git-core
$
終わった。途中の対応を除いても実に 40分近くはかかった。

インストールされた git は /opt/local/bin に配置されている。
$ which git
/opt/local/bin/git
git のバージョンは 1.7.3.5。前回ソースでいれた時よりも結構バージョンが上がっている。
$ git --version
git version 1.7.3.5

- - - -
普段から MacPorts を使っていれば今回みたいに依存パッケージを一気にダウンロードするということは無いと思うので、すんなり行くのかもしれない。何はともあれ良かった。

Tower - Git管理GUIツール

2010年12月3日金曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

Towerベータ版を使い始めたが結構いい感じ。



画面は3ペインで、左にブランチ、右上にファイルリスト、右下に修正内容が表示される。
ブランチ、タグ、リモートリポジトリ、Stash を一覧して見ることができる。

これはCommit履歴を表示させたところ。



これ一つで Staging、Commit、Push までひと通りの操作が行える。

Xcodeを開いてファイルを修正していると、その修正を自動的に検出してリストアップしてくれる。

通常は作業の区切りでこれら確認して (add →) stage → commit していく。

Dockアイコンには未commitの修正ファイル数が表示される。

commit するとこれがクリアされる。これが作業終了の区切りとなってちょっと気分がいい。

部分的(chunk)に Stageすることもできるようだ。

ファイル操作のメニュー


Commit のメタ情報を条件に検索することもできる。
こんな感じ。

様々な Diff /Merge ツールに対応していて選ぶことができる。



複数のリポジトリが扱えるがウィンドウは1つしか開かない。1つのウィンドウを切り替えて使うスタイルになる。
これは将来複数ウィンドウ化を期待したい。



- - - - -
ファイル更新の自動検出のアイディアは秀逸。このおかげで特に工夫することなくXcodeと連携して使うことができる。これがかなりいい。現時点ではベータ版で無料だが Registration... というメニューがあることから正式版は有料になる可能性がある。よく出来ているので正式版が出たら購入するかもしれない。

なお現時点で Commit Message に日本語が入力できなかった。

tig - コマンドライン git ビューア

2010年12月1日水曜日 | Published in | 0 コメント

このエントリーをはてなブックマークに追加

tigはコマンドラインベースの git ツール。見た目が結構カラフル。

公式サイト Index of /tig


インストール


環境:Mac OS X 10.6.4

下記より最新版のソースコードをダウンロードできる。
Index of /tig/releases

今回は tig-0.16.2.tar.gz をダウンロードした。

~/src/ へ落とした後、解凍、ビルドする。
$ cd ~/src
$ tar xvfz tig-0.16.2.tar.gz
  :
$ cd tig-0.16.2
$ ./configure
$ make
$ sudo make install

ビルドされた tig コマンドは /usr/local/bin にインストールされている。


使い方


詳しいマニュアルが用意されている。
The tig Manual

移動などの操作は vi ライクのキーバインドとなっている。k で上へ、j で下へ、といった感じ。vi同様 / による検索もできる。

ビューの切り替えが使う上でのポイント。
[-] generic bindings                                                            
View switching                                                                  
    'm'                       view-main            Show main view               
    'd'                       view-diff            Show diff view               
    'l'                       view-log             Show log view                
    't'                       view-tree            Show tree view               
    'f'                       view-blob            Show blob view               
    'B'                       view-blame           Show blame view              
    'H'                       view-branch          Show branch view             
    'h'                       view-help            Show help page               
    'p'                       view-pager           Show pager view              
    'S'                       view-status          Show status view             
    'c'                       view-stage           Show stage view  

操作体系は独特だが慣れると軽快でなかなか良い。

人気の投稿(過去 30日間)