[27] 
[DFN[Git]] は[[バージョン管理システム]]です。

[28] 
[[CVS]]、[[Subversion]] などを置き換え[[バージョン管理システム]]の[[事実上の標準]]となっています。
普及開始期には似たコンセプトと操作性の [[Mercurial]] 
と市場を二分していましたが、
[[GitHub]] の成功もあって [[Git]] への移行が進みました。

* リダイレクト

[16] [[HTTPリダイレクト]]を使って、旧[[リポジトリー]]の[[ディレクトリー]]以下すべての
[[path]] と [[query]] を保存して新[[リポジトリー]]の [[URL]]
を示せば、 [[git]] [[クライアント]]に新[[リポジトリー]]を参照させることができます。

;; [17] 実際には [CODE[repo.git/info/refs?service=git-upload-pack]] と [CODE[repo.git/git-upload-pack]]
を[[リダイレクト]]すれば十分なようです。

* [CODE(URI)@en[git:]] URL scheme

[19] [CODE(URI)@en[[[git:]]]] [[URL scheme]] は [[Git]] 独自の[[プロトコル]]を表します。

[18] [CITE[git-clone(1)]]
( ([TIME[2013-02-15 19:24:45 +09:00]] 版))
<https://www.kernel.org/pub/software/scm/git/docs/git-clone.html#URLS>

[51] 
[[GitHub]] はこのプロトコルへの対応をやめてしまいました。
[[セキュリティー]]のためとはいえ[[非互換変更]]は困ったものです。

[54] [CITE@en-US[cpanm - get, unpack build and install modules from CPAN - metacpan.org]], [TIME[2023-08-23T07:31:20.000Z]] <https://metacpan.org/dist/App-cpanminus/view/bin/cpanm#arguments>

>
[PRE(code)[
cpanm git://github.com/plack/Plack.git@1.0000        # tag
cpanm git://github.com/plack/Plack.git@devel         # branch
]PRE]

[55] >>54 これは本家 [CODE[git]] にない独自仕様。


* git commit するべきものがないエラー

[29] 
なにも変更なく
[CODE[git commit]]
すると、

>
no changes added to commit

... とエラーメッセージが出て、
[[exit code]] が [N[1]]
で失敗して終了します。

[30] 
[CODE[--allow-empty]]
オプションをつけて実行すればエラーになるのは防げますが、
空のコミットは作られてしまいます。

[32] 
変更がなくてもエラーにならず、
空のコミットを作らせもせず、
しかしそれ以外のエラーがあれば通常通り報告させたいときは、

>
git diff-index --quiet HEAD --cached || git commit

... とすれば良いようであります [SRC[>>31]]。


[REFS[
- [31] [CITE[python - How to git commit nothing without an error? - [[Stack Overflow]]]], [TIME[2021-04-09T02:30:41.000Z]] <https://stackoverflow.com/questions/8123674/how-to-git-commit-nothing-without-an-error>
]REFS]

* ファイルサイズ制限

[33] 
[[git]] としては問題なくても、ホスティングサービスでエラーになる[[ファイル]]サイズ制限があります。

-*-*-

[35] 
[[GitHub]] ではファイルのサイズが 50MB で警告、 100MB で push 拒否されます。
[SRC[>>34]]

[36] 
[[GitHub]] の [[Webブラウザー]]インターフェイスでは 25MB 
超のファイルをアップロードできません。
[SRC[>>34]]

[44] 
[[BitBucket]] の文書にはファイルサイズの制限が見当たりません。制限はないのかも知れません。

[50] 
[[BitBucket]] は数百MBでもOK。

[57] 
[[BitBucket]] は令和6年5月から100MB制限となります。
ただしこの制限は設定により解除できます。
また、既存の100MB以上のファイルはそのままとなります。
[SRC[>>56]]

[58] 
[[BitBucket]] は50MB以上のファイルがあると push 時に警告が出ます。
[TIME[2025-06-28T10:05:01.500Z]]

[61] 
ファイルサイズの制限はどこでも基本的に無圧縮のそのままの状態のサイズの制限です。

-*-*-

[37] 
[[GitHub]] は[[リポジトリー]]のサイズが 1GB 未満を推奨、
5GB 未満を強く推奨しています。
また [[GitHub]] の動作に支障があるレベルだと連絡が来るそうです
(が具体的な条件は書かれていません)。
[SRC[>>34]]

[46] 
[[GitHub]] は以前は 75GB が警告、 100GB が上限と書かれていたそうです。
その後 5GB 超で削除要求メールが来たという報告があります。
[SRC[>>45]]

[40] 
[[BitBucket]] はリポジトリーが 1GB で警告メールが来て、 2GB で push できなくなります。
[SRC[>>39]]
[[Git]] 限定とは書いていないので
[[Mercurial]] (サービス終了済み) も同じでしょうか。

[43] >>40 より新しいドキュメントには、実際にはそれより上限が緩い旨が書かれています。
[SRC[>>41, >>42]]

[59] 
[[BitBucket]] の >>58 の警告には 4GB がリポジトリーのサイズ制限と書かれています。
[TIME[2025-06-28T10:05:51.500Z]]


[48] 
[[GitLab.com]] 
では[[リポジトリー]]サイズの最大が 10GB です。
[SRC[>>47]]

-*-*-

[49] 
[[GitLab.com]] は令和4年10月から namespace ごとのストレージ上限が適用されます。
おそらくリポジトリーはこのストレージサイズの枠内に入っているので、
Free プランだと5GBが最大になります。

[60] 
[[BitBucket]] は令和7年から無料 workspace のサイズが1GB上限となります。

[REFS[
-
[34] 
[CITE@en[About large files on [[GitHub]] - GitHub Docs]], [TIME[2022-08-01T10:04:27.000Z]] <https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github>
-
[45] 
[CITE@en[git - Repository size limits for GitHub.com - [[Stack Overflow]]]], [TIME[2022-08-01T10:34:29.000Z]] <https://stackoverflow.com/questions/38768454/repository-size-limits-for-github-com#:~:text=Repositories%20have%20a%20hard%20size%20limit%20of%20100GB.&text=Files%20can%20also%20be%20shared,such%20file%20is%202%20GB.>
-
[38] [CITE@en[Repository size limits | [[Bitbucket]] Blog]]
([TIME[2017-12-09 23:32:38 +09:00]])
<https://blog.bitbucket.org/2014/05/30/repository-size-limits/>
-
[39] [CITE@en[What kind of limits do you have on repository/file/upload size? - [[Atlassian]] Documentation]]
([TIME[2017-12-09 23:35:10 +09:00]])
<https://confluence.atlassian.com/bitbucket/what-kind-of-limits-do-you-have-on-repository-file-upload-size-273877699.html>
-
[41] 
[CITE@en-US[Reduce repository size | [[Bitbucket Cloud]] | Atlassian Support]], [TIME[2022-08-01T09:41:36.000Z]], [TIME[2022-08-01T10:19:20.459Z]] <https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/>
-
[42] 
[CITE@en-US[Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022 - [[Bitbucket]]]], [TIME[2022-08-01T10:21:42.000Z]] <https://bitbucket.org/blog/git-push-size-limits-are-coming-to-bitbucket-cloud-starting-april-4th-2022>
-
[47] 
[CITE@en-us[GitLab.com settings | [[GitLab]]]], [TIME[2022-08-01T12:08:15.000Z]], [TIME[2022-08-01T13:02:24.206Z]] <https://docs.gitlab.com/ee/user/gitlab_com/index.html#account-and-limit-settings>
-
[56] 
[CITE@en[[[Bitbucket]] Cloud is implementing a 100 MB limit on ... - Atlassian Community]], [TIME[2024-04-30T10:55:28.000Z]] <https://community.atlassian.com/t5/Bitbucket-articles/Bitbucket-Cloud-is-implementing-a-100-MB-limit-on-files-included/ba-p/2629017>



]REFS]


* ホスティングサービス

[SEE[ [[GitHub]], [[GitLab]] ]]

* メモ

[1] [CITE[InterfacesFrontendsAndTools - GitWiki]]
([TIME[2009-09-23 11:11:14 +09:00]] 版)
<http://git.or.cz/gitwiki/InterfacesFrontendsAndTools>

[2] [CITE@en[Git - Fast Version Control System]]
([TIME[2009-10-02 17:40:57 +09:00]] 版)
<http://git-scm.com/>

[3] [CITE[git(1)]]
([TIME[2009-05-26 20:16:51 +09:00]] 版)
<http://www8.atwiki.jp/git_jp/pub/git-manual-jp/Documentation/git.html>

[4] [CITE@ja[CVS リポジトリを Git へ移行する | ITEMAN Blog - アイテマンブログ]]
([TIME[2009-10-08 19:35:34 +09:00]] 版)
<http://iteman.jp/blog/2009/05/cvs-git.html>

[5] [CITE[cvs2svn: cvs2git Documentation]]
([TIME[2009-10-11 16:33:12 +09:00]] 版)
<http://cvs2svn.tigris.org/cvs2git.html>

[6] [CITE[git-cvsimport(1)]]
( ([TIME[2011-01-31 14:03:56 +09:00]] 版))
<http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html>

[7] [CITE[hatena/Git-for-Designers - GitHub]]
( ([TIME[2012-02-07 23:36:31 +09:00]] 版))
<https://github.com/hatena/Git-for-Designers>

[8] [[submodule]] のリスト
[PRE[
$ git config -f .gitmodules --get-regexp "^submodule\.[^.]+\.path$"| sed 's/^submodule\.\(\S\+\)\.path.*/\1/'|xargs -l1 -i% -- sh -c 'echo git submodule add `git config -f .gitmodules --get "submodule.%.url"` `git config -f .gitmodules --get "submodule.%.path"`'
]PRE]


[9] [CITE[Git on WebApp with Perl // Speaker Deck]]
( ([TIME[2012-07-15 17:59:36 +09:00]] 版))
<https://speakerdeck.com/u/hakobe/p/git-on-webapp-with-perl>

[10] [CITE[Git on WebApp with perl - Kyoto.pm Tech Talks #01 - YouTube]]
( ([TIME[2012-07-15 18:01:45 +09:00]] 版))
<http://www.youtube.com/watch?v=mZ93iLTHrlg>

[11] [CITE[Git::Repository - search.cpan.org]]
( ([TIME[2012-07-15 18:02:14 +09:00]] 版))
<http://search.cpan.org/dist/Git-Repository/lib/Git/Repository.pm>

[12] [CITE[Guita/lib/Guita/Mapper/Git.pm at master · hakobe/Guita · GitHub]]
( ([TIME[2012-07-15 18:05:05 +09:00]] 版))
<https://github.com/hakobe/Guita/blob/master/lib/Guita/Mapper/Git.pm>

[13] [CITE[git-submodule-track]]
( ([TIME[2014-04-04 10:20:16 +09:00]] 版))
<https://gist.github.com/motemen/667573>

[14] [CITE@en[Git の特定リビジョンのツリーをファイルシステムのように扱う Go の実装 - 詩と創作・思索のひろば]]
([TIME[2015-03-10 11:15:40 +09:00]] 版)
<http://motemen.hatenablog.com/entry/2014/12/16/go-vcs-fs>

[FIG(quote)[
[FIGCAPTION[
[15] [CITE@en[libgit2]]
([TIME[2014-12-06 12:01:56 +09:00]] 版)
<https://libgit2.github.com/>
]FIGCAPTION]

> libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API, allowing you to write native speed custom Git applications in any language which supports C bindings.

]FIG]

[20] 
[PRE(code)[
$ git config --global color.ui auto
]PRE]


[FIG(quote)[
[FIGCAPTION[
[21] [CITE@en[SPDX Specification 2.1 (web version) | Software Package Data Exchange (SPDX)]]
( ([TIME[2016-12-20 16:40:30 +09:00]]))
<https://spdx.org/spdx-specification-21-web-version#h.49x2ik5>
]FIGCAPTION]

> SPDX supports git, git+git, git+https git+http and git+ssh transports. git and git+git are equivalent.
>  

]FIG]


[FIG(quote)[
[FIGCAPTION[
[22] [CITE[install | npm Documentation]]
([TIME[2017-11-20 17:01:58 +09:00]])
<https://docs.npmjs.com/cli/install>
]FIGCAPTION]

> Installs the package from the hosted git provider, cloning it with git. For a full git remote url, only that URL will be attempted.
>     <protocol>://'''['''<user>'''[''':<password>''']'''@''']'''<hostname>'''[''':<port>''']''''''[''':''']''''''['''/''']'''<path>'''['''#<commit-ish> | #semver:<semver>''']'''
> <protocol> is one of git, git+ssh, git+http, git+https, or git+file.
> If #<commit-ish> is provided, it will be used to clone exactly that commit. If the commit-ish has the format #semver:<semver>, <semver> can be any valid semver range or exact version, and npm will look for any tags or refs matching that range in the remote repository, much as it would for a registry dependency. If neither #<commit-ish> or #semver:<semver> is specified, then master is used.

]FIG]


[FIG(quote)[
[FIGCAPTION[
[23] [CITE[install | npm Documentation]]
([TIME[2017-11-20 17:03:11 +09:00]])
<https://docs.npmjs.com/cli/install>
]FIGCAPTION]

>     npm install git+ssh://git@github.com:npm/npm.git#v1.0.27
>     npm install git+ssh://git@github.com:npm/npm#semver:^5.0
>     npm install git+https://isaacs@github.com/npm/npm.git
>     npm install git://github.com/npm/npm.git#v1.0.27

]FIG]


[FIG(quote)[
[FIGCAPTION[
[24] [CITE@en[TipsAndTricks/NPM - Yocto Project]]
([TIME[2016-10-21 09:06:14 +09:00]])
<https://wiki.yoctoproject.org/wiki/TipsAndTricks/NPM>
]FIGCAPTION]

> SRC_URI = "git://github.com/martinaglv/cute-files.git;protocol=https \

]FIG]


[FIG(quote)[
[FIGCAPTION[
[25] [CITE[BitBake User Manual]]
([TIME[2017-11-20 17:22:09 +09:00]])
<http://www.yoctoproject.org/docs/2.4/bitbake-user-manual/bitbake-user-manual.html#git-fetcher>
]FIGCAPTION]

> Here are some example URLs:
>      SRC_URI = "git://git.oe.handhelds.org/git/vip.git;tag=version-1"
>      SRC_URI = "git://git.oe.handhelds.org/git/vip.git;protocol=http"

]FIG]


[FIG(quote)[
[FIGCAPTION[
[26] [CITE[BitBake User Manual]]
([TIME[2017-11-20 17:23:26 +09:00]])
<http://www.yoctoproject.org/docs/2.4/bitbake-user-manual/bitbake-user-manual.html#gitsm-fetcher>
]FIGCAPTION]

> 4.3.6. Git Submodule Fetcher (gitsm://)¶
> This fetcher submodule inherits from the Git fetcher and extends that fetcher's behavior by fetching a repository's submodules. SRC_URI is passed to the Git fetcher as described in the "Git Fetcher (git://)" section.
> Notes and Warnings
> You must clean a recipe when switching between 'git://' and 'gitsm://' URLs.
> The Git Submodules fetcher is not a complete fetcher implementation. The fetcher has known issues where it does not use the normal source mirroring infrastructure properly.

]FIG]

[52] [CODE[GIT_SSL_NO_VERIFY]]

[FIG(quote)[
[FIGCAPTION[
[53] [CITE[git security fixes lead to "fatal: transport 'file' not allowed" error in CI systems; CVE-2022-39253 - Logbook]]
([TIME[2022-11-21T07:57:11.000Z]])
<https://vielmetti.typepad.com/logbook/2022/10/git-security-fixes-lead-to-fatal-transport-file-not-allowed-error-in-ci-systems-cve-2022-39253.html>
]FIGCAPTION]

> git config --global protocol.file.allow always

]FIG]


[62] Git と GitHub と情報技術者の評判を落としまくっている政党にはさっさと退場してもらいたかったので、当選してしまったのは残念だなあ [TIME[2025-07-22T05:59:06.444Z]]