{"id":37313,"date":"2023-04-22T00:23:37","date_gmt":"2023-11-17T20:18:55","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/"},"modified":"2024-04-30T00:39:29","modified_gmt":"2024-04-29T16:39:29","slug":"git%e7%9a%84%e6%9c%ba%e5%88%b6-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/","title":{"rendered":"Git\u7684\u673a\u5236"},"content":{"rendered":"<h1>\u9996\u5148<\/h1>\n<p>Git\u662f\u4e00\u79cd\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u88ab\u5e7f\u6cdb\u4f7f\u7528\u3002\u901a\u8fc7\u4f7f\u7528Git\uff0c\u591a\u4eba\u5728\u7ba1\u7406\u540c\u4e00\u9879\u76ee\u65f6\uff0c\u7248\u672c\u63a7\u5236\u548c\u4ee3\u7801\u5171\u4eab\u53d8\u5f97\u66f4\u52a0\u5bb9\u6613\u3002<\/p>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u89e3\u91caGit\u662f\u5982\u4f55\u901a\u8fc7\u63d0\u4ea4(commit)\u3001\u5206\u652f(branch)\u3001\u6807\u7b7e(tag)\u3001HEAD\u7b49\u529f\u80fd\u6765\u5de5\u4f5c\u7684\u3002<\/p>\n<h1>\u57fa\u672c\u539f\u7406<\/h1>\n<p>BLOB\u3001\u6811\u3001\u63d0\u4ea4\u662fGit\u6570\u636e\u7ed3\u6784\u7684\u4e3b\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u5b83\u4eec\u6784\u6210\u4e86Git\u7684\u57fa\u7840\u3002<\/p>\n<p>\u4e3a\u4e86\u7406\u89e3\u8fd9\u4e9b\u8981\u7d20\uff0c\u6211\u4f1a\u4e3e\u4f8b\u52a0\u4ee5\u8bf4\u660e\u3002<\/p>\n<p>\u9996\u5148\uff0c\u8ba9\u6211\u4eec\u8003\u8651\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684\u5b58\u50a8\u5e93\u7684\u60c5\u51b5\u3002\u6267\u884c\u547d\u4ee4 git init \u540e\uff0cGit \u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a .git \u7684\u9690\u85cf\u6587\u4ef6\u5939\u3002\u8be5\u6587\u4ef6\u5939\u7528\u4e8e\u5b58\u50a8Git\u5185\u90e8\u4f7f\u7528\u7684\u6570\u636e\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/7-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2023-05-08 1.24.44.png\" \/><\/div>\n<h2>\u4e8c\u8fdb\u5236\u5927\u5bf9\u8c61<\/h2>\n<p>\u5728Git\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528git add\u547d\u4ee4\u5c06\u6587\u4ef6\u6dfb\u52a0\u5230\u4ed3\u5e93\u4e2d\u3002<br \/>\n\u672c\u6b21\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3amyfile.txt\u7684\u6587\u4ef6\uff0c\u5e76\u4f7f\u7528\u547d\u4ee4git add myfile.txt\u6765\u5c06\u5176\u6dfb\u52a0\u8fdb\u53bb\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">### myfile.txt \u3092\u4f5c\u6210<\/span>\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">echo<\/span> <span class=\"s2\">\"hello\"<\/span> <span class=\"o\">&gt;<\/span> myfile.txt\r\n\r\n<span class=\"c\">### Git \u30ea\u30dd\u30b8\u30c8\u30ea\u306b myfile.txt \u3092\u8ffd\u52a0<\/span>\r\n<span class=\"nv\">$ <\/span>git add myfile.txt \r\n<\/code><\/pre>\n<p>\u8fdb\u884c\u6b64\u64cd\u4f5c\u65f6\uff0cGit \u5c06\u5728 .git\/objects \u5b50\u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u540d\u4e3a BLOB \u7684\u6587\u4ef6\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/12-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2023-05-08 1.31.14.png\" \/><\/div>\n<p>\u8fd9\u4e2a BLOB \u5b58\u50a8\u4e86 myfile.txt \u7684\u5185\u5bb9\u3002\u5b83\u4e0d\u5305\u542b\u76f8\u5173\u7684\u5143\u6570\u636e\uff0c\u5982\u521b\u5efa\u65f6\u95f4\u6233\u548c\u521b\u5efa\u8005\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">### `git catfile` \u30b3\u30de\u30f3\u30c9\u3067 BLOB \u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u8868\u793a<\/span>\r\n<span class=\"c\">### \uff08\u30b3\u30f3\u30c6\u30f3\u30c4\u7a2e\u5225\u306b\u5fdc\u3058\u305f\u8868\u793a\u306e\u6700\u9069\u5316\u3092\u884c\u3046\u305f\u3081\u3001`-p`\u3000\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u4e0e\uff09<\/span>\r\n<span class=\"nv\">$ <\/span>git cat-file <span class=\"nt\">-p<\/span> ce013625030ba8dba906f756967f9e9ca394464a \r\nhello\r\n<\/code><\/pre>\n<p>BLOB \u540d\u79f0\u662f\u6839\u636e\u5185\u5bb9\u7684\u54c8\u5e0c\u503c\u6765\u547d\u540d\u7684\u3002\u5185\u5bb9\u7ecf\u8fc7\u54c8\u5e0c\u5316\u540e\uff0c\u524d\u4e24\u4e2a\u5b57\u7b26\u5c06\u4f5c\u4e3a.git\/objects\u7684\u5b50\u6587\u4ef6\u5939\u540d\u79f0\uff0c\u5269\u4f59\u7684\u5b57\u7b26\u5c06\u88ab\u7528\u4f5cBLOB\u540d\u79f0\u3002<\/p>\n<p>\u6362\u53e5\u8bdd\u8bf4\uff0c\u5c06\u6587\u4ef6\u6dfb\u52a0\u5230 Git \u4e2d\u65f6\uff0c\u4f1a\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Git\u4f1a\u83b7\u53d6\u6587\u4ef6\u7684\u5185\u5bb9\u5e76\u8fdb\u884c\u54c8\u5e0c\u5316\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Git\u4f1a\u5728.git\/objects\u6587\u4ef6\u5939\u4e2d\u521b\u5efaBLOB\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>\u4f7f\u7528\u54c8\u5e0c\u503c\u7684\u524d\u4e24\u4e2a\u5b57\u7b26\u521b\u5efa\u5b50\u6587\u4ef6\u5939\u3002<br \/>\n\u5728\u521b\u5efa\u7684\u5b50\u6587\u4ef6\u5939\u4e0b\uff0c\u4f7f\u7528\u54c8\u5e0c\u503c\u7684\u5269\u4f59\u5b57\u7b26\u547d\u540dBLOB\u3002<\/p>\n<p>Git\u4f1a\u5c06\uff08\u538b\u7f29\u7684\uff09\u539f\u59cb\u6587\u4ef6\u5185\u5bb9\u4fdd\u5b58\u5728BLOB\u4e2d\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/18-0.png\" alt=\"undefined\" \/><\/div>\n<p>\u987a\u5e26\u4e00\u63d0\uff0c\u5982\u679c\u5b58\u5728\u4e24\u4e2a\u4e0d\u540c\u7684\u6587\u4ef6\u540d\u5206\u522b\u4e3amyfile.txt\u548courfile.txt\uff0c\u5e76\u4e14\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u5b8c\u5168\u76f8\u540c\uff0c\u90a3\u4e48\u5b83\u4eec\u5c06\u5177\u6709\u76f8\u540c\u7684\u54c8\u5e0c\u503c\uff0c\u5e76\u5b58\u50a8\u5728\u540c\u4e00\u4e2aBLOB\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">### myfile.txt \u3092\u30b3\u30d4\u30fc\u3057\u3001ourfile.txt \u3092\u4f5c\u6210<\/span>\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">cp<\/span> <span class=\"nt\">-p<\/span> myfile.txt ourfile.txt\r\n\r\n<span class=\"c\">### ourfile.txt \u3092 `git add` \u3057\u3001BLOB \u304c\u65b0\u3057\u304f\u751f\u6210\u3055\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d<\/span>\r\n<span class=\"nv\">$ <\/span>git add ourfile.txt \r\n<span class=\"nv\">$ <\/span>find .git\/objects <span class=\"nt\">-type<\/span> f\r\n.git\/objects\/ce\/013625030ba8dba906f756967f9e9ca394464a\r\n<span class=\"nv\">$ <\/span>\r\n<\/code><\/pre>\n<p>\u53e6\u5916\uff0c\u5f53\u60a8\u7a0d\u5fae\u4fee\u6539\u4e86myfile.txt\u7684\u5185\u5bb9\u5e76\u518d\u6b21\u6dfb\u52a0\u5230\u5b58\u50a8\u5e93\u65f6\uff0cGit\u4f1a\u91cd\u65b0\u6267\u884c\u524d\u9762\u63d0\u5230\u7684\u6d41\u7a0b\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u7531\u4e8e\u54c8\u5e0c\u503c\u7684\u6539\u53d8\uff0c\u5c06\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684BLOB\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">### myfile.txt \u306e\u5185\u5bb9\u3092\u5c11\u3057\u5909\u66f4\u3057\u3001\u518d\u5ea6 `git add` \u3092\u5b9f\u65bd<\/span>\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">cat <\/span>myfile.txt \r\nhello!\r\n<span class=\"nv\">$ <\/span>git add myfile.txt \r\n\r\n<span class=\"c\">### BLOB \u30d5\u30a1\u30a4\u30eb\u304c\u65b0\u3057\u304f\u751f\u6210\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d<\/span>\r\n<span class=\"nv\">$ <\/span>find .git\/objects <span class=\"nt\">-type<\/span> f\r\n.git\/objects\/4e\/ffa19f4f75f846c3229b9dbdbad14eff362f32\r\n.git\/objects\/ce\/013625030ba8dba906f756967f9e9ca394464a\r\n\r\n<span class=\"c\">### \u305d\u308c\u305e\u308c\u306e BLOB \u306b\u3064\u3044\u3066\u4e2d\u8eab\u3092\u78ba\u8a8d<\/span>\r\n<span class=\"nv\">$ <\/span>git cat-file <span class=\"nt\">-p<\/span> ce013625030ba8dba906f756967f9e9ca394464a\r\nhello\r\n<span class=\"nv\">$ <\/span>git cat-file <span class=\"nt\">-p<\/span> 4effa19f4f75f846c3229b9dbdbad14eff362f32\r\nhello!\r\n<\/code><\/pre>\n<h2>\u6811<\/h2>\n<p>\u6211\u6253\u7b97\u5728\u8fd9\u91cc\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a&#8221;mysubfolder&#8221;\u7684\u5b50\u6587\u4ef6\u5939\uff0c\u5e76\u5728\u5176\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a&#8221;yourfile.txt&#8221;\u7684\u6587\u4ef6\uff0c\u7136\u540e\u5c06\u5176\u6dfb\u52a0\u5230\u7248\u672c\u5e93\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">### mysubfolder \u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210<\/span>\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">mkdir <\/span>mysubfolder\r\n\r\n<span class=\"c\">### mysubfolder \u914d\u4e0b\u306b yourfile.txt \u3092\u4f5c\u6210<\/span>\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">echo<\/span> <span class=\"s2\">\"world\"<\/span> <span class=\"o\">&gt;<\/span> mysubfolder\/yourfile.txt\r\n\r\n<span class=\"c\">### Git \u30ea\u30dd\u30b8\u30c8\u30ea\u306b mysubfolder\/yourfile.txt \u3092\u8ffd\u52a0<\/span>\r\n<span class=\"nv\">$ <\/span>git add mysubfolder\/yourfile.txt \r\n<\/code><\/pre>\n<p>\u901a\u8fc7\u8be5\u64cd\u4f5c\uff0cGit \u5c06\u4f1a\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a yourfile.txt \u7684 BLOB\uff08\u4e8c\u8fdb\u5236\u5927\u5bf9\u8c61\uff09\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/27-0.png\" alt=\"undefined\" \/><\/div>\n<p>\u63a5\u4e0b\u6765\uff0c\u4f7f\u7528\u547d\u4ee4 git commit \u6765\u63d0\u4ea4 myfile.txt \u548c yourfile.txt \u4e24\u4e2a\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">### myfile.txt \u3068 mysubfolder\/yourfile.txt\u3000\u3092\u30b3\u30df\u30c3\u30c8<\/span>\r\n<span class=\"nv\">$ <\/span>git commit <span class=\"nt\">-m<\/span><span class=\"s2\">\"first commit\"<\/span>\r\n<span class=\"o\">[<\/span>master <span class=\"o\">(<\/span>root-commit<span class=\"o\">)<\/span> c262f57] first commit\r\n 2 files changed, 2 insertions<span class=\"o\">(<\/span>+<span class=\"o\">)<\/span>\r\n create mode 100644 myfile.txt\r\n create mode 100644 mysubfolder\/yourfile.txt\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/30-0.png\" alt=\"undefined\" \/><\/div>\n<p>\u5728\u8fd9\u4e2a\u64cd\u4f5c\u4e2d\uff0cGit \u5c06\u6267\u884c\u4ee5\u4e0b\u4e24\u4e2a\u6b65\u9aa4\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u521b\u5efa\u5b58\u50a8\u5e93\u7684\u6839\u76ee\u5f55\u6811\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u521b\u5efa\u63d0\u4ea4\u3002<\/ol>\n<p>\u6839\u76ee\u5f55\u6811\u662f\u8bb0\u5f55\u5b58\u50a8\u5e93\u4e2d\u6240\u6709\u6587\u4ef6\u548c\u6587\u4ef6\u5939\u7ed3\u6784\u7684\u4f4d\u7f6e\u3002\u6839\u76ee\u5f55\u6811\u5305\u542b\u5b58\u50a8\u5e93\u4e2d\u6240\u6709\u6587\u4ef6\u548c\u5b50\u6587\u4ef6\u5939\u7684\u5f15\u7528\uff0c\u5e76\u5177\u6709\u9012\u5f52\u7ed3\u6784\u3002<br \/>\n\u6839\u76ee\u5f55\u6811\u7684\u6bcf\u4e00\u884c\u90fd\u5f15\u7528\u4e86\u6587\u4ef6\u6216\u5176\u4ed6\u5b50\u6811\u3002\u7c7b\u4f3c\u5730\uff0c\u8fd9\u4e9b\u6587\u4ef6\u548c\u5b50\u6811\u4e5f\u5f15\u7528\u4e86\u5176\u4ed6\u6587\u4ef6\u548c\u5b50\u6811\u3002\u8fd9\u4f7f\u5f97\u6811\u5177\u6709\u7c7b\u4f3c\u76ee\u5f55\u7684\u7ed3\u6784\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u60a8\u53ef\u4ee5\u50cf\u4ece\u76ee\u5f55\u8bbf\u95ee\u6587\u4ef6\u548c\u5b50\u6587\u4ef6\u5939\u4e00\u6837\uff0c\u53ef\u4ee5\u4ece\u6811\u4e2d\u8bbf\u95eeBLOB\u6216\u5b50\u6811\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>git cat-file <span class=\"nt\">-p<\/span> 0fa5b90dcd339c2f52b492a5126ccb760478e\r\n100644 blob cc628ccd10742baea8241c5924df992b5c019f71\tyourfile.txt\r\n\r\n<span class=\"nv\">$ <\/span>git cat-file <span class=\"nt\">-p<\/span> 9b35f55d56eb0c921c533ae31a6a0ed9c7859\r\n100644 blob ce013625030ba8dba906f756967f9e9ca394464a\tmyfile.txt\r\n040000 tree 0fa5b90dcd339c2f52b492a5126ccb760478ecbd\tmysubfolder\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/35-0.png\" alt=\"undefined\" \/><\/div>\n<p>\u4e00\u65e6Git\u521b\u5efa\u4e86\u6839\u6811\u53ca\u5176\u76f8\u5173\u7684\u6240\u6709\u5b50\u6811\uff0c\u5c31\u4f1a\u5982\u524d\u6240\u8ff0\u5bf9\u5b83\u4eec\u8fdb\u884c\u54c8\u5e0c\u5904\u7406\u5e76\u4fdd\u5b58\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u6bcf\u4e2a\u6811\u90fd\u4f1a\u88ab\u54c8\u5e0c\u5904\u7406\uff0c\u7136\u540e\u4f7f\u7528\u524d\u4e24\u4e2a\u5b57\u7b26\u5728.git\/objects\u76ee\u5f55\u4e0b\u521b\u5efa\u5b50\u6587\u4ef6\u5939\uff0c\u5e76\u5c06\u5269\u4f59\u7684\u54c8\u5e0c\u5b57\u7b26\u4e32\u4f5c\u4e3a\u4fdd\u5b58\u7684\u6587\u4ef6\u540d\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u5c31\u4f1a\u521b\u5efa\u51fa\u4e0e\u6811\u4e2d\u6570\u636e\u7ed3\u6784\u6570\u91cf\u76f8\u7b49\u7684\u65b0\u6587\u4ef6\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/37-0.png\" alt=\"undefined\" \/><\/div>\n<h2>\u63d0\u4ea4<\/h2>\n<p>\u6267\u884c\u63d0\u4ea4\u540e\uff0c\u5c06\u4ee5\u5305\u542b\u4ee5\u4e0b\u5143\u6570\u636e\u4fe1\u606f\u7684\u5f62\u5f0f\u5c06\u6587\u4ef6\u4fdd\u5b58\u4e0b\u6765\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30eb\u30fc\u30c8\u30c4\u30ea\u30fc (tree)<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u89aa\u30b3\u30df\u30c3\u30c8 (parent commit)<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u2026\u5b58\u5728\u3059\u308b\u5834\u5408<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u4f5c\u6210\u8005\u306e\u540d\u524d\u304a\u3088\u3073\u96fb\u5b50\u30e1\u30fc\u30eb (author)<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30b3\u30df\u30c3\u30bf\u30fc\u306e\u540d\u524d\u304a\u3088\u3073\u96fb\u5b50\u30e1\u30fc\u30eb (committer)<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8 (feat)<\/ul>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>git cat-file <span class=\"nt\">-p<\/span> c262f5725e96f52c6bf1dbebcaf2680570fba\r\ntree 9b35f55d56eb0c921c533ae31a6a0ed9c7859057\r\nauthor John Doe &lt;johndoe@example.com&gt; 1683579147 +0900\r\ncommitter John Doe &lt;johndoe@example.com&gt; 1683579147 +0900\r\n\r\nfirst commit\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/42-0.png\" alt=\"undefined\" \/><\/div>\n<p>\u5f53\u521b\u5efa\u63d0\u4ea4\u6587\u4ef6\u65f6\uff0cGit\u4f1a\u5bf9\u5176\u5185\u5bb9\u8fdb\u884c\u54c8\u5e0c\u5904\u7406\uff0c\u5e76\u4f7f\u7528\u8be5\u54c8\u5e0c\u6765\u4fdd\u5b58\u5185\u5bb9\u5230\u65b0\u6587\u4ef6\u4e2d\u3002\u6587\u4ef6\u5939\u540d\u4f7f\u7528.git\/objects\u7684\u5b50\u6587\u4ef6\u5939\u7684\u524d\u4e24\u4e2a\u5b57\u7b26\uff0c\u5269\u4e0b\u7684\u54c8\u5e0c\u5b57\u7b26\u4e32\u5c06\u4f5c\u4e3aBLOB\u7684\u540d\u79f0\u6784\u6210\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/44-0.png\" alt=\"undefined\" \/><\/div>\n<h1>\u5904\u7406\u6267\u884c\u65f6\u7684\u884c\u4e3a<\/h1>\n<h2>\u5206\u652f<\/h2>\n<p>\u5206\u652f\u662f Git \u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u5c06\u4ee3\u7801\u7684\u53d8\u66f4\u5c65\u5386\u5206\u5f00\u3002\u4f7f\u7528\u5206\u652f\u53ef\u4ee5\u4f7f\u591a\u4eba\u5728\u540c\u4e00\u9879\u76ee\u4e0a\u5de5\u4f5c\u65f6\uff0c\u6bcf\u4e2a\u4eba\u90fd\u53ef\u4ee5\u72ec\u7acb\u5730\u8fdb\u884c\u5de5\u4f5c\u3002<\/p>\n<p>\u6267\u884c git branch mybranch \u547d\u4ee4\u65f6\uff0c\u4f1a\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a mybranch \u7684\u65b0\u5206\u652f\uff0c\u5e76\u751f\u6210\u4e00\u4e2a\u540d\u4e3a .git\/refs\/heads\/mybranch \u7684\u65b0\u6587\u4ef6\u3002\u8fd9\u4e2a\u6587\u4ef6\u5305\u542b\u4e86\u65b0\u5206\u652f\u7684\u6e90\u63d0\u4ea4\u7684\u54c8\u5e0c\u503c\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">### mybranch \u3068\u3044\u3046\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210<\/span>\r\n<span class=\"nv\">$ <\/span>git branch mybranch\r\n\r\n<span class=\"c\">### \u30d6\u30e9\u30f3\u30c1\u306e\u72b6\u614b\u3092\u78ba\u8a8d<\/span>\r\n<span class=\"nv\">$ <\/span>git branch\r\n<span class=\"k\">*<\/span> master\r\n  mybranch\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/50-0.png\" alt=\"undefined\" \/><\/div>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">cat<\/span>  .git\/refs\/heads\/mybranch\r\nc262f5725e96f52c6bf1dbebcaf2680570fba434\r\n\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">cat<\/span> .git\/logs\/refs\/heads\/mybranch\r\n0000000000000000000000000000000000000000 c262f5725e96f52c6bf1dbebcaf2680570fba434 John Doe &lt;johndoe@example.com&gt; 1683662253 +0900\tbranch: Created from master\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/52-0.png\" alt=\"undefined\" \/><\/div>\n<p>\u63a5\u4e0b\u6765\uff0c\u5728mybranch\u4e0a\u8fdb\u884c\u65b0\u7684\u63d0\u4ea4\uff0c\u5982\u524d\u6240\u8ff0\uff0cGit\u4f1a\u521b\u5efa\u6839\u6811\u548c\u63d0\u4ea4\u6587\u4ef6\uff0c\u5e76\u5c06\u5206\u652f\u6587\u4ef6\u66f4\u65b0\u4e3a\u65b0\u63d0\u4ea4\u7684\u54c8\u5e0c\u503c\u3002<br \/>\n\u56e0\u6b64\uff0c\u5206\u652f\u662f\u8ddf\u8e2a\u63d0\u4ea4\u7684\u6587\u4ef6\uff0c\u8fd9\u4e9b\u6587\u4ef6\u7684\u5185\u5bb9\u4f1a\u5728\u6bcf\u6b21\u8fdb\u884c\u63d0\u4ea4\u65f6\u66f4\u65b0\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">### \u30d6\u30e9\u30f3\u30c1\u3092 mybranch \u306b\u5207\u308a\u66ff\u3048<\/span>\r\n<span class=\"nv\">$ <\/span>git checkout mybranch\r\n\r\n<span class=\"c\">### myfile2.txt \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001Git \u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u8ffd\u52a0<\/span>\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">echo<\/span> <span class=\"s2\">\"branch test\"<\/span> <span class=\"o\">&gt;<\/span> myfile2.txt\r\n<span class=\"nv\">$ <\/span>git add myfile2.txt \r\n\r\n<span class=\"c\">### myfile2.txt \u3092\u30b3\u30df\u30c3\u30c8<\/span>\r\n<span class=\"nv\">$ <\/span>git commit <span class=\"nt\">-m<\/span> <span class=\"s2\">\"second commit\"<\/span>\r\n<span class=\"o\">[<\/span>mybranch 92efc63] second commit\r\n 1 file changed, 1 insertion<span class=\"o\">(<\/span>+<span class=\"o\">)<\/span>\r\n create mode 100644 myfile2.txt\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">cat<\/span>  .git\/refs\/heads\/mybranch\r\n92efc63e7150cc2924db956c2f540facfb46dfa2\r\n\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">cat<\/span> .git\/logs\/refs\/heads\/mybranch\r\n0000000000000000000000000000000000000000 c262f5725e96f52c6bf1dbebcaf2680570fba434 John Doe &lt;johndoe@example.com&gt; 1683662253 +0900\tbranch: Created from master\r\nc262f5725e96f52c6bf1dbebcaf2680570fba434 92efc63e7150cc2924db956c2f540facfb46dfa2 John Doe &lt;johndoe@example.com&gt; 1683663583 +0900\tcommit: second commit\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/56-0.png\" alt=\"undefined\" \/><\/div>\n<h2>\u6807\u7b7e (biaoqian)<\/h2>\n<p>\u6807\u7b7e\u662f\u5bf9\u7279\u5b9a\u63d0\u4ea4\u7684\u6c38\u4e45\u5f15\u7528\u3002<\/p>\n<p>\u5982\u679c\u6267\u884c\u4e86 git tag mytag \u547d\u4ee4\u5e76\u521b\u5efa\u4e86\u540d\u4e3a mytag \u7684\u65b0\u6807\u7b7e\uff0cGit \u4f1a\u5728\u8def\u5f84 .git\/refs\/tags \u4e0b\u751f\u6210\u4e00\u4e2a\u540d\u4e3a mytag \u7684\u65b0\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>git tag mytag\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/61-0.png\" alt=\"undefined\" \/><\/div>\n<p>\u4e0e\u5206\u652f\u6587\u4ef6\u7c7b\u4f3c\uff0c\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u5305\u542b\u4e86\u521b\u5efa\u6807\u7b7e\u6240\u7528\u7684\u63d0\u4ea4\u54c8\u5e0c\u3002\u7136\u800c\uff0c\u4e0e\u5206\u652f\u6587\u4ef6\u4e0d\u540c\u7684\u662f\uff0c\u6807\u7b7e\u6587\u4ef6\u4e0d\u4f1a\u968f\u7740\u5de5\u4f5c\u7684\u8fdb\u884c\u800c\u66f4\u65b0\uff0c\u800c\u662f\u7ee7\u7eed\u6307\u5411\u521b\u5efa\u5b83\u7684\u7279\u5b9a\u63d0\u4ea4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">cat<\/span> .git\/refs\/tags\/mytag\r\n92efc63e7150cc2924db956c2f540facfb46dfa2\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/64-0.png\" alt=\"undefined\" \/><\/div>\n<h2>\u9996\u5148<\/h2>\n<p>&#8220;HEAD&#8221; \u662f\u6307\u5411\u5f53\u524d\u5de5\u4f5c\u5206\u652f\u6700\u65b0\u63d0\u4ea4\u7684\u6307\u9488\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5b83\u6307\u793a\u4e86\u6b63\u5728\u5de5\u4f5c\u7684\u5206\u652f\u4e2d\u7684\u6700\u65b0\u63d0\u4ea4\u3002<\/p>\n<p>Git\u4f7f\u7528HEAD\u6765\u8bc6\u522b\u5f53\u524d\u6b63\u5728\u64cd\u4f5c\u7684\u5206\u652f\u3002\u6bd4\u5982\uff0c\u5f53\u8fd0\u884cgit branch\u547d\u4ee4\u65f6\uff0cGit\u4f1a\u67e5\u770bHEAD\u6765\u5224\u65ad\u5f53\u524d\u6240\u5728\u7684\u5206\u652f\u3002<br \/>\n\u6b64\u5916\uff0c\u5728\u53c2\u8003\u5373\u5c06\u8fdb\u884c\u7684\u63d0\u4ea4\u7684\u7236\u63d0\u4ea4\u65f6\u4e5f\u4f1a\u4f7f\u7528HEAD\u3002\u521b\u5efa\u63d0\u4ea4\u65f6\uff0c\u7236\u63d0\u4ea4\u5c06\u88ab\u8bb0\u5f55\u5728\u65b0\u7684\u63d0\u4ea4\u4e2d\u3002<\/p>\n<p>\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5f53\u4f7f\u7528\u4e3b\u5206\u652f\uff08master branch\uff09\u65f6\uff0cHEAD\u6307\u5411\u4e3b\u5206\u652f\u3002\u6b64\u65f6\uff0cHEAD\u6587\u4ef6\u4e2d\u4f1a\u5199\u7740ref: refs\/heads\/master\u3002<br \/>\n\u5982\u679c\u6211\u4eec\u5207\u6362\u5230\u4e00\u4e2a\u540d\u4e3amybranch\u7684\u5206\u652f\uff0c\u5e76\u6253\u5f00.git\u6587\u4ef6\u5939\u4e2d\u7684HEAD\u6587\u4ef6\uff0c\u53ef\u4ee5\u786e\u8ba4\u91cc\u9762\u5199\u7740ref: refs\/heads\/mybranch\u3002<br \/>\n\u56e0\u6b64\uff0cHEAD\u4e0d\u76f4\u63a5\u6307\u5411\u63d0\u4ea4\uff08commit\uff09\uff0c\u800c\u662f\u5145\u5f53\u6307\u5411\u5206\u652f\u6700\u65b0\u63d0\u4ea4\u7684\u6307\u9488\u3002\u8fd9\u4f7f\u5f97Git\u80fd\u591f\u8ffd\u8e2a\u5f53\u524d\u68c0\u51fa\u7684\u63d0\u4ea4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">### master \u30d6\u30e9\u30f3\u30c1\u306b\u5207\u308a\u66ff\u3048\u3001HEAD \u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d<\/span>\r\n<span class=\"nv\">$ <\/span>git checkout master\r\nSwitched to branch <span class=\"s1\">'master'<\/span>\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">cat<\/span> .git\/HEAD\r\nref: refs\/heads\/master\r\n\r\n<span class=\"c\">### mybranch \u30d6\u30e9\u30f3\u30c1\u306b\u5207\u308a\u66ff\u3048\u3001HEAD \u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d<\/span>\r\n<span class=\"nv\">$ <\/span>git checkout mybranch\r\nSwitched to branch <span class=\"s1\">'mybranch'<\/span>\r\n<span class=\"nv\">$ <\/span><span class=\"nb\">cat<\/span> .git\/HEAD\r\nref: refs\/heads\/mybranch\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/70-0.png\" alt=\"undefined\" \/><\/div>\n<p>\u5f53\u5728\u5206\u652f\u4e0a\u6267\u884c\u63d0\u4ea4\u65f6\uff0cGit\u4f1a\u8bfb\u53d6HEAD\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u5e76\u5c06\u5176\u4f5c\u4e3a\u53c2\u8003\u6765\u5199\u5165\u4f5c\u4e3a\u7236\u63d0\u4ea4\u7684\u63d0\u4ea4\uff0c\u56e0\u6b64\u53ef\u4ee5\u8bf4HEAD\u95f4\u63a5\u5730\u63d0\u4f9b\u4e86\u4e0b\u4e00\u4e2a\u63d0\u4ea4\u7684\u7236\u63d0\u4ea4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">cat<\/span> .git\/refs\/heads\/mybranch\r\n92efc63e7150cc2924db956c2f540facfb46dfa2\r\n\r\n<span class=\"nv\">$ <\/span>git cat-file <span class=\"nt\">-p<\/span> 92efc63e7150cc2924db956c2f540facfb46dfa2\r\ntree 02f94dfeb44bdbc4e5253e100b701b388a1a59fe\r\nparent c262f5725e96f52c6bf1dbebcaf2680570fba434\r\nauthor John Doe &lt;johndoe@example.com&gt; 1683663583 +0900\r\ncommitter John Doe &lt;johndoe@example.com&gt; 1683663583 +0900\r\n\r\nsecond commit\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/73-0.png\" alt=\"undefined\" \/><\/div>\n<p>\u901a\u8fc7\u8fd9\u6837\u505a\uff0c\u60a8\u53ef\u4ee5\u5728Git\u4e2d\u68c0\u51fa\u5148\u524d\u7684\u63d0\u4ea4\u5e76\u4ece\u90a3\u91cc\u5f00\u59cb\u66f4\u6539\u3002\u8fd9\u79cd\u6a21\u5f0f\u88ab\u79f0\u4e3a\u201c\u5206\u79bb\u6a21\u5f0f\u201d\u3002HEAD \u4e0d\u518d\u5f15\u7528\u5206\u652f\uff0c\u800c\u662f\u76f4\u63a5\u6307\u5411\u7279\u5b9a\u7684\u63d0\u4ea4\u3002<\/p>\n<p>\u5728\u8fdb\u884c\u63d0\u4ea4\u7684\u68c0\u51fa\u3001\u4fee\u6b63\u3001\u8bc4\u4f30\u548c\u6bd4\u8f83\u65f6\uff0c\u5206\u79bb\u6a21\u5f0f\u901a\u5e38\u88ab\u4f7f\u7528\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5f53HEAD\u6307\u5411\u67d0\u4e2a\u5206\u652f\u65f6\uff0c\u521b\u5efa\u65b0\u7684\u63d0\u4ea4\u4f1a\u81ea\u52a8\u79fb\u52a8\u8be5\u5206\u652f\uff0c\u5e76\u5c06\u65b0\u7684\u63d0\u4ea4\u4e0e\u8be5\u5206\u652f\u5173\u8054\u8d77\u6765\u3002\u7136\u800c\uff0c\u5728\u5206\u79bb\u6a21\u5f0f\u4e0b\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5373\u4f7f\u521b\u5efa\u4e86\u65b0\u7684\u63d0\u4ea4\uff0c\u56e0\u4e3aHEAD\u6307\u5411\u7684\u63d0\u4ea4\u4e0d\u4f1a\u6539\u53d8\uff0c\u6240\u4ee5\u65b0\u7684\u63d0\u4ea4\u5c06\u4e0d\u4f1a\u4e0e\u4efb\u4f55\u5206\u652f\u76f8\u5173\u8054\u3002<\/p>\n<h2>\u5408\u5e76<\/h2>\n<p>Git\u7684\u5408\u5e76\u662f\u5c06\u5728\u4e0d\u540c\u5206\u652f\u4e0a\u8fdb\u884c\u7684\u66f4\u6539\u5408\u5e76\u4e3a\u4e00\u4e2a\u8fc7\u7a0b\u3002\u8fd9\u6837\u53ef\u4ee5\u5c06\u4ee3\u7801\u66f4\u6539\u6574\u5408\u8d77\u6765\u5e76\u4fdd\u6301\u5206\u652f\u7684\u5386\u53f2\u8bb0\u5f55\u3002<\/p>\n<p>\u5728Git\u4e2d\uff0c\u4e3b\u8981\u6709\u4e24\u79cd\u7c7b\u578b\u7684\u5408\u5e76\uff1aNo-ff\u5408\u5e76\u548cFast-forward\u5408\u5e76\u3002<\/p>\n<h3>\u4e0d\u4f7f\u7528\u5feb\u8fdb\u5f0f\u5408\u5e76<\/h3>\n<p>\u5f53\u4e24\u4e2a\u5206\u652f\u53d1\u751f\u5206\u5c90\u65f6\uff0c\u4f1a\u51fa\u73b0No-ff\u5408\u5e76\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cGit\u4f1a\u521b\u5efa\u4e00\u4e2a\u5177\u6709\u4e24\u4e2a\u7236\u8282\u70b9\u7684\u65b0\u63d0\u4ea4\u3002\u7b2c\u4e00\u4e2a\u7236\u8282\u70b9\u662f\u5f53\u524d\u5206\u652f\u7684\u6700\u65b0\u63d0\u4ea4\uff0c\u800c\u7b2c\u4e8c\u4e2a\u7236\u8282\u70b9\u662f\u8981\u5408\u5e76\u7684\u5206\u652f\u7684\u6700\u65b0\u63d0\u4ea4\u3002\u901a\u8fc7\u8fd9\u4e2a\u65b0\u63d0\u4ea4\uff0c\u4e24\u4e2a\u5206\u652f\u7684\u66f4\u6539\u90fd\u4f1a\u88ab\u4f53\u73b0\u51fa\u6765\u3002<\/p>\n<p>No-ff\u5408\u5e76\u53ef\u80fd\u4f1a\u53d1\u751f\u51b2\u7a81\u3002\u5f53\u4e24\u4e2a\u53d8\u66f4\u8bd5\u56fe\u4fee\u6539\u540c\u4e00\u4e2a\u6587\u4ef6\u6216\u884c\u65f6\uff0c\u5c31\u4f1a\u53d1\u751f\u51b2\u7a81\u3002\u5728\u6709\u51b2\u7a81\u7684\u60c5\u51b5\u4e0b\uff0cGit\u9700\u8981\u624b\u52a8\u89e3\u51b3\u51b2\u7a81\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/81-0.png\" alt=\"undefined\" \/><\/div>\n<h3>\u5feb\u8fdb \u5408\u5e76<\/h3>\n<p>\u5feb\u901f\u524d\u8fdb\u5408\u5e76\u662f\u6307\u5f53\u6709\u4e24\u4e2a\u5206\u652f\u540c\u65f6\u5b58\u5728\u65f6\uff0c\u5206\u652fA\u6ca1\u6709\u8d85\u8fc7\u5206\u652fB\u6240\u5bfc\u81f4\u7684\u60c5\u51b5\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5206\u652fA\u5728\u7ee7\u7eed\u8fdb\u884c\u65f6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cGit\u4f1a\u7b80\u5355\u5730\u5c06\u5f53\u524d\u5206\u652f\u7684\u6700\u65b0\u63d0\u4ea4\u79fb\u52a8\u5230\u8981\u5408\u5e76\u7684\u5206\u652f\u7684\u6700\u65b0\u63d0\u4ea4\u3002\u8fd9\u6837\u5c31\u5c06\u4e24\u4e2a\u5206\u652f\u7684\u5386\u53f2\u8bb0\u5f55\u5408\u5e76\u5728\u4e00\u8d77\uff0c\u5e76\u53cd\u6620\u4e86\u66f4\u6539\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/84-0.png\" alt=\"undefined\" \/><\/div>\n<h1>\u5f15\u7528\u8d44\u6599<\/h1>\n<ul class=\"post-ul\">Web\u30b5\u30a4\u30c8, &#8220;How Git truly works&#8221;, Alberto Prospero, https:\/\/towardsdatascience.com\/how-git-truly-works-cd9c375966f6<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 Git\u662f\u4e00\u79cd\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u88ab\u5e7f\u6cdb\u4f7f\u7528\u3002\u901a\u8fc7\u4f7f\u7528Git\uff0c\u591a\u4eba\u5728\u7ba1\u7406\u540c\u4e00\u9879\u76ee\u65f6\uff0c\u7248\u672c\u63a7\u5236\u548c [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-37313","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Git\u7684\u673a\u5236 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/git\u7684\u673a\u5236-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git\u7684\u673a\u5236\" \/>\n<meta property=\"og:description\" content=\"\u9996\u5148 Git\u662f\u4e00\u79cd\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u88ab\u5e7f\u6cdb\u4f7f\u7528\u3002\u901a\u8fc7\u4f7f\u7528Git\uff0c\u591a\u4eba\u5728\u7ba1\u7406\u540c\u4e00\u9879\u76ee\u65f6\uff0c\u7248\u672c\u63a7\u5236\u548c [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/git\u7684\u673a\u5236-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-17T20:18:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T16:39:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/7-0.png\" \/>\n<meta name=\"author\" content=\"\u79d1, \u9896\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u79d1, \u9896\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/\",\"name\":\"Git\u7684\u673a\u5236 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-11-17T20:18:55+00:00\",\"dateModified\":\"2024-04-29T16:39:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git\u7684\u673a\u5236\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e\",\"name\":\"\u79d1, \u9896\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g\",\"caption\":\"\u79d1, \u9896\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keying\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Git\u7684\u673a\u5236 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/git\u7684\u673a\u5236-2\/","og_locale":"zh_CN","og_type":"article","og_title":"Git\u7684\u673a\u5236","og_description":"\u9996\u5148 Git\u662f\u4e00\u79cd\u5206\u5e03\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff0c\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u88ab\u5e7f\u6cdb\u4f7f\u7528\u3002\u901a\u8fc7\u4f7f\u7528Git\uff0c\u591a\u4eba\u5728\u7ba1\u7406\u540c\u4e00\u9879\u76ee\u65f6\uff0c\u7248\u672c\u63a7\u5236\u548c [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/git\u7684\u673a\u5236-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-11-17T20:18:55+00:00","article_modified_time":"2024-04-29T16:39:29+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d2da237434c4406c51dcb\/7-0.png"}],"author":"\u79d1, \u9896","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u79d1, \u9896","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/","name":"Git\u7684\u673a\u5236 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-11-17T20:18:55+00:00","dateModified":"2024-04-29T16:39:29+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"Git\u7684\u673a\u5236"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e","name":"\u79d1, \u9896","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g","caption":"\u79d1, \u9896"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keying\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e7%9a%84%e6%9c%ba%e5%88%b6-2\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=37313"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37313\/revisions"}],"predecessor-version":[{"id":88624,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37313\/revisions\/88624"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=37313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=37313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=37313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}