Action disabled: source

github

http://github.com はバージョン管理システム git のホスティングサービス。

無料アカウントの場合、一定のデータ量まで利用でき、公開レポジトリのみ作成できる。

gitの諸機能やレポジトリの状況が視覚化され、ユーザ間でどのように共同作業を行うのか、といったことが感覚的に理解しやすい。

gitgithubの関係は、bazaarlaunchpad.netの関係に似ている。

GitHub for Windows

github からの clone

2010-12-24

github から clone するときに origin ではなく github というリモート名がつくようにするには:

$ git clone --origin github git@github.com:nishimotz/libopenjtalk.git
$ cd libopenjtalk
$ git remote
github

このとき github における master が、clone した作業リポジトリにおける新たな master になる(らしい)。

github から branch を fetch

2011-02-28

マシンAとマシンBに作業ディレクトリがあり master ブランチが存在するとする。

マシンAから新しいブランチnbをgithubにpushする。

マシンBからブランチnbをつかいたい。

マシンBの作業ディレクトリにて(originでgithubが参照できるとして)、git fetch をつかう。git branch -r で確認できる:

$ git branch -r
  origin/HEAD
  origin/master

$ git fetch origin
From git@github.com:nishimotz/repos
 * [new branch]      nb     -> origin/nb

$ git branch 
* master

$ git branch -r 
  origin/HEAD
  origin/master
  origin/nb

origin/nb を取り出す:

$ git checkout -f origin/nb

master 以外のブランチ

github に master 以外のブランチがある場合、どうすれば使える??

http://stackoverflow.com/questions/67699/how-do-i-clone-all-remote-branches-with-git

$ git branch -a
* master
  github/HEAD
  github/master
  github/nvdajp
  github/ubuntu_sjis

$ git checkout -b github/ubuntu_sjis

オプション -b をつけないとおこられる:

Note: moving to "github/ubuntu_sjis" which isn't a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
  git checkout -b <new_branch_name>

「基底ブランチ」が master 以外の場合は何がちがうのか??

ブランチを消す

http://gitready.com/beginner/2009/02/02/push-and-delete-branches.html

origin のブランチを消す:

git push origin :newfeature

ローカルのブランチを消す:

git branch -d newfeature

タグ

since 2011-10-16

ローカルで tag をつけて、github に push すると (tagの名前).zip というアーカイブが落とせるようになる。

タグは過去の状態にさかのぼって checkout してつけることができる。

例えば、commits 画面で特定のコミットの SHA 文字列(16進数)を確認して、下記のように:

https://github.com/nishimotz/htsengineapi/commits/master

$ git checkout 5e2f3e7cae43498bdf648a61e91d0c22c36d0546
$ git tag nvdajp-111015
$ git push github nvdajp-111015

git_tag にも関連記事。

github のタグを消すには

  • ローカルで tag -d して push –tags しても github 側のタグは消えない
  • push github :タグ名 する
$ git tag -d nvdajp-111015
Deleted tag 'nvdajp-111015' (was 5e2f3e7)

$ git push github :nvdajp-111015
To git@github.com:nishimotz/htsengineapi.git
 - [deleted]         nvdajp-111015
github.txt · 最終更新: 2014/02/05 14:58 by Takuya Nishimoto
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0