そごうソフトウェア研究所

SOA、開発プロセス、ITアーキテクチャなどについて書いています。Twitterやってます@rsogo

GitHubメモ

会社でやっているプロジェクトは複数の会社で構成されることが多く、GitHubを使ってます。 まだそれほど大規模な使い方では無いのでPrivate Projectで運用しています。

Issue管理や、Wikiも使用してコミュニケーションしています。 設計書はお客さんに提出する関係で、Officeで作っているけどこれもWikiに移行していけたらいいな、と思ってますが表や、図の書きやすさはまだまだMS Officeの方が良い。

Wikiにはプロジェクトに入ったら知っておいて欲しいルールや、環境の情報、Tipsなんかを書いていっています。

このエントリでは、GitHubを使う時のメモを書いていっています。

Step 1. リポジトリのクローン

GitHub上のプロジェクトをローカルに取得する

$ git clone https://github.com/AAA/BBB.git BBB/

URLの部分はGitHubリポジトリ画面の右下から持ってくることができます。 f:id:begirama:20140214164753p:plain

Step 2. ファイルの追加

$ vi test.txt  
$ ls  
README.md   test.txt  
$ git add test.txt   

Step 3. ローカルへのコミット

$ git commit -m "テスト用のファイルを追加"  
[master 2588d93] テスト用のファイルを追加  
 1 file changed, 1 insertion(+)  
 create mode 100644 test.txt  

Step 4. GitHubへのPush

$ git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 369 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/AAA/BBB.git
   1e9e805..2588d93  master -> master

これで、GitHub上に先ほどのファイルが更新される。

f:id:begirama:20140215110747p:plain

push.defaultが定義されていないという警告がでたので、設定する。

git config --global push.default simple