• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

おまけにしようと思ったのですが、長くなりそうなので別記事にします。

ブランチv1.1をサーバにpushする:

   1  % git push origin refs/heads/v1.1

タグv1.1をサーバにpushする:

   1  % git push origin refs/tags/v1.1 
   2  Counting objects: 1, done.
   3  Writing objects: 100% (1/1), 159 bytes, done.
   4  Total 1 (delta 0), reused 0 (delta 0)
   5  To ssh://git.s21g.com/mnt/git/ezPhotoMail.git
   6   * [new tag]         v1.1 -> v1.1

ローカルのタグをすべてサーバにpushする:

via http://github.com/guides/push-tags-to-github

   1  % git push --tags

サーバのタグを取得するには

tagをpushしたサーバ上のrepoをcloneすればtagも勝手に取得してくれるようです。cloneしてから、tagのブランチを作れば内容が確認できます。

   1  % git tag -l
   2  v1.1
   3  % git checkout -b 1.1 refs/tags/v1.1

又はブランチを作らずに内容を確認:

   1  % git checkout refs/tags/v1.1

posted by Png satoko on Fri 13 Mar 2009 at 16:19

ブランチ、タグ両方にv1.1があると、ambiguousだと怒られました。

   1  % git show v1.1
   2  warning: refname 'v1.1' is ambiguous.

ということで探してみたら、下記の記述:

fmfm フルパス?で指定してみると、うまく表示されました!:

   1  % git show refs/tags/v1.1  

posted by Png satoko on Fri 13 Mar 2009 at 12:35 with 2 comments

各コミットに割り当てられるSHA1は長いので、その頭数桁をabbreviated commit hash/commit checksumなどと呼びます。適当な長さで良いようです:ex. 7-8桁。

数桁って何桁やねん!と思って探したのですが、見つけられませんでした。そういえば昔何かのlibraryの作者にバグ報告したときに、githubのコミットSHA1の頭五桁を送ってくれって言われたことがありました。ということで適当でいいみたいですね。この適当さ加減が良い。そしてそういう風にも使えるのですね。

このhashはtag設定時等に指定できます:

   1  % git tag -a v1.1 0d86f96 -m "version 1.1"
   2  % git show fb47ddb2

Pretty formatsのformatに記述されていました: abbreviated commit hash

%h: abbreviated commit hash
http://www.kernel.org/pub/software/scm/git/docs/git-show.html#_pretty_formats

learn.githubでタグ時の説明に:commit checksum

And I forgot to tag the project at ‘v1.2’, which was at the ‘updated rakefile’ commit, I can add it after the fact. To tag that commit, you can just specify the commit checksum (or part of it) at the end of the command.

$ git tag -a v1.2 9fceb02
http://learn.github.com/p/tagging.html#tagging_later

posted by Png satoko on Fri 13 Mar 2009 at 12:25 with 2 comments