/
21.txt
292 lines (212 loc) · 11 KB
/
21.txt
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
[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>
* 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]] の文書にはファイルサイズの制限が見当たりません。制限はないのかも知れません。
[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]]
[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>
]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]