{"id":37920,"date":"2023-07-23T12:11:25","date_gmt":"2023-11-12T14:35:06","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/"},"modified":"2024-04-30T14:56:52","modified_gmt":"2024-04-30T06:56:52","slug":"%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/","title":{"rendered":"\u4f7f\u7528 git hooks \u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d [Git] stash"},"content":{"rendered":"<h2>\u5e8f\u8a00<\/h2>\n<p>\u4f60\u4eec\u4f7f\u7528\u8fc7git stash\u5417\uff1f\u7b80\u5355\u6765\u8bf4\uff0c\u8fd9\u662f\u4e00\u4e2a\u53ef\u4ee5\u5c06\u8fd8\u672a\u63d0\u4ea4\u6216\u6dfb\u52a0\u7684\u5de5\u4f5c\u4e2d\u7684\u66f4\u6539\u5185\u5bb9\u6682\u5b58\u8d77\u6765\u7684\u547d\u4ee4\u3002<\/p>\n<p>\u5173\u4e8egit stash\u7684\u7b80\u660e\u89e3\u91ca\u5728\u8fd9\u91cc\u3010git stash\u3011\u5f53\u4f60\u60f3\u9000\u907f\u66f4\u6539\u800c\u4e0d\u8fdb\u884c\u63d0\u4ea4\u65f6- Qiita<\/p>\n<p>\u5178\u578b\u7684\u60c5\u51b5\u5982\u4e0b\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u4f5c\u696d\u4e2d\u306b\u6025\u306a\u5bfe\u5fdc\u7b49\u3067\u5225\u306e\u4f5c\u696d\u30d6\u30e9\u30f3\u30c1\u306b\u79fb\u52d5\u3057\u305f\u3044<\/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\">\u3057\u304b\u3057\u3001\u3084\u308a\u304b\u3051\u306e\u4f5c\u696d\u304c\u90aa\u9b54\u3092\u3057\u3066\u30d6\u30e9\u30f3\u30c1\u306e\u79fb\u52d5\u304c\u3067\u304d\u306a\u3044<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u307e\u3060\u4e2d\u9014\u534a\u7aef\u306a\u72b6\u614b\u3060\u304b\u3089\u30b3\u30df\u30c3\u30c8\u306f\u3057\u305f\u304f\u306a\u3044<\/ul>\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6267\u884c git stash \u547d\u4ee4\u4f1a\u5c06\u6b63\u5728\u8fdb\u884c\u7684\u66f4\u6539\u6682\u5b58\u8d77\u6765\u3002\u56e0\u6b64\uff0c\u53ef\u4ee5\u5148\u5904\u7406\u5176\u4ed6\u5206\u652f\u7684\u9700\u6c42\uff0c\u7136\u540e\u5207\u56de\u539f\u6765\u7684\u5de5\u4f5c\u5206\u652f\uff0c\u5e76\u6062\u590d\u4e4b\u524d\u6682\u5b58\u7684\u66f4\u6539\uff0c\u5c31\u53ef\u4ee5\u56de\u5230\u6700\u521d\u7684\u72b6\u6001\u3002<\/p>\n<h2>\u95ee\u9898\u6240\u5728<\/h2>\n<p>\u867d\u7136 git stash \u5f88\u65b9\u4fbf\uff0c\u4f46\u6709\u4e00\u4e2a\u9ebb\u70e6\u7684\u95ee\u9898\u3002<br \/>\n\u6709\u65f6\u4f1a\u5fd8\u8bb0\u6062\u590d\u4fdd\u5b58\u7684\u66f4\u6539\u3002<\/p>\n<p>\u6267\u884cgit stash\u540e\uff0cgit status\u7684\u72b6\u6001\u5c06\u53d8\u4e3a&#8221;nothing to commit, working tree clean&#8221;\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u663e\u793a\u7684\u72b6\u6001\u4e0e\u6ca1\u6709\u4efb\u4f55\u53d8\u66f4\u7684\u60c5\u51b5\u76f8\u540c\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u5c31\u5bb9\u6613\u5fd8\u8bb0\u6267\u884c\u4e86git stash\u3002<\/p>\n<p>\u6beb\u7121\u7591\u554f\u5730\uff0cgit stash\u5f8c\u6211\u6703\u8a18\u5f97\uff0c\u4f46\u7576\u6211\u5207\u63db\u5230\u5176\u4ed6\u5206\u652f\u6216\u8005\u5fd9\u65bc\u5176\u4ed6\u5de5\u4f5c\uff0c\u4e26\u4e14\u6642\u9593\u8f03\u9577\uff0c\u6211\u5c31\u6703\u76f8\u7576\u5bb9\u6613\u5730\u5fd8\u8a18\u4e86\u3002<\/p>\n<h2>\u7b54\u6848<\/h2>\n<p>\u6211\u8ba4\u4e3a\u6700\u5bb9\u6613\u5fd8\u8bb0\u7684\u4e3b\u8981\u539f\u56e0\u662f\u65e0\u8bba\u662f\u5426\u8fdb\u884cgit stash\uff0c\u5916\u89c2\u4e0a\u51e0\u4e4e\u6ca1\u6709\u533a\u522b\u3002\u90a3\u4e48\uff0c\u5982\u679c\u6211\u4eec\u6839\u636e\u5916\u89c2\u8fdb\u884c\u89e3\u51b3\uff0c\u5c82\u4e0d\u662f\u53ef\u4ee5\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u5417\uff1f<\/p>\n<p>\u56e0\u6b64\uff0c\u96d6\u7136\u524d\u8a00\u6709\u9ede\u9577\uff0c\u4f46\u4eca\u5929\u6211\u60f3\u5206\u4eab\u4e00\u4e0b\uff0c\u7576\u6211\u4f7f\u7528 git stash \u6307\u4ee4\u6642\uff0c\u5982\u4f55\u5728\u5c4f\u5e55\u4e0a\u986f\u793a\u5b83\uff0c\u4ee5\u9632\u6b62\u5fd8\u8a18\u9084\u539f\u66f4\u6539\u7684\u65b9\u6cd5\u3002<\/p>\n<h2>\u5df2\u786e\u8ba4\u64cd\u4f5c\u73af\u5883<\/h2>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">git version 2.23.0<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">git version 2.11.0.windows.3<\/ul>\n<p>\u6211\u6b63\u5728\u4f7f\u7528 GitBash \u5728 Windows \u4e0a\u8fdb\u884c\u786e\u8ba4\u3002<\/p>\n<h2>\u5f15\u5165\u7a0b\u5e8f<\/h2>\n<p>\u6211\u4f7f\u7528githooks\u3002<br \/>\n\u4f7f\u7528\u5b83\uff0c\u53ef\u4ee5\u6267\u884c\u4e0eGit\u7279\u5b9a\u64cd\u4f5c\u89e6\u53d1\u7684\u811a\u672c\u3002<\/p>\n<p>\u8fd9\u6b21\u7684\u60c5\u51b5\u4e0b\uff0c\u6211\u6253\u7b97\u521b\u5efa\u4e00\u4e2a\u811a\u672c\uff0c\u5b83\u5728\u6267\u884cgit checkout\u65f6\u89e6\u53d1\u3002\u539f\u56e0\u662f\uff0c\u6211\u5e0c\u671b\u5728\u5b8c\u6210\u5206\u652f\u5207\u6362\u540e\uff0c\u5c4f\u5e55\u4e0a\u663e\u793a\u6709stash\u5b58\u5728\u7684\u6d88\u606f\uff0c\u8fd9\u6837\u6211\u5c31\u4e0d\u5bb9\u6613\u5fd8\u8bb0\u5b83\u4eec\u4e86\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u65f6\u673a\u662f\u6211\u60f3\u77e5\u9053\u6b63\u5728\u4fdd\u5b58stash\u7684\u65f6\u523b\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u6211\u4eec\u8981\u521b\u5efa\u4e00\u4e2a\u4ee5git checkout\u4e3a\u89e6\u53d1\u7684\u811a\u672c\uff0c\u8be5\u811a\u672c\u8d1f\u8d23\u5728\u5c4f\u5e55\u4e0a\u663e\u793astash\u7684\u5b58\u5728\u4e0e\u5426\u4f5c\u4e3a\u76ee\u6807\u3002<\/p>\n<p>\u5728git checkout\u4e4b\u540e\u7acb\u5373\u6267\u884c\u7684\u540d\u4e3apost-checkout\u7684hook\u975e\u5e38\u9002\u5408\u6211\u4eec\u7684\u9700\u6c42\uff0c\u6beb\u4e0d\u72b9\u8c6b\u5730\u51b3\u5b9a\u4f7f\u7528\u5b83\u3002<\/p>\n<h3>\u521b\u5efa\u7ed3\u8d26\u540e\u64cd\u4f5c<\/h3>\n<p>\u7576\u79fb\u52d5\u5230\u958b\u767c\u4e2d\u7684\u5b58\u5132\u5eab\u7684\u6839\u76ee\u9304\u4e0b\u6642\uff0c\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u5728.git\/hooks\u76ee\u9304\u4e0b\u5275\u5efapost-checkout\u6587\u4ef6\u3002\u4e0d\u9700\u8981\u6587\u4ef6\u64f4\u5c55\u540d\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\"># \u65b0\u898f\u4f5c\u6210<\/span>\r\n<span class=\"nb\">touch<\/span> .git\/hooks\/post-checkout\r\n\r\n<span class=\"c\"># \u5b9f\u884c\u6a29\u9650\u3092\u4ed8\u4e0e(755\u3058\u3083\u306a\u304f\u3066\u3082\u5b9f\u884c\u3055\u3048\u3067\u304d\u308c\u3070\u306a\u3093\u3067\u3082\u3088\u3044)<\/span>\r\n<span class=\"nb\">chmod <\/span>755 .git\/hooks\/post-checkout\r\n<\/code><\/pre>\n<h3>\u5b89\u88c5\u94a9\u5b50\u4e2d\u7684\u5185\u5bb9<\/h3>\n<p>\u5b9e\u73b0\u4e00\u4e2a\u811a\u672c\uff0c\u53ef\u4ee5\u68c0\u67e5\u5b58\u50a8\u5e93\u7684\u5b58\u5728\u4e0e\u5426\u5e76\u8f93\u51fa\u7ed3\u679c\u3002\u8bf7\u7f16\u8f91\u4e4b\u524d\u521b\u5efa\u7684 post-checkout \u6587\u4ef6\u5982\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"c\">#!\/bin\/bash<\/span>\r\n\r\n<span class=\"nv\">STASH_LIST<\/span><span class=\"o\">=<\/span><span class=\"si\">$(<\/span>git stash list<span class=\"si\">)<\/span>\r\n\r\n<span class=\"k\">if<\/span> <span class=\"o\">[<\/span> <span class=\"nt\">-n<\/span> <span class=\"s2\">\"<\/span><span class=\"nv\">$STASH_LIST<\/span><span class=\"s2\">\"<\/span> <span class=\"o\">]<\/span><span class=\"p\">;<\/span> <span class=\"k\">then\r\n  <\/span><span class=\"nb\">echo<\/span> <span class=\"s1\">''<\/span>\r\n  <span class=\"nb\">echo<\/span> <span class=\"nt\">-e<\/span> <span class=\"s2\">\"<\/span><span class=\"se\">\\0<\/span><span class=\"s2\">33[1;31;239m<\/span><span class=\"sb\">`<\/span><span class=\"nb\">echo<\/span> <span class=\"nv\">$STASH_LIST<\/span> | <span class=\"nb\">wc<\/span> <span class=\"nt\">-l<\/span> | xargs <span class=\"nb\">echo<\/span><span class=\"sb\">`<\/span><span class=\"s2\"> stashed works found.<\/span><span class=\"se\">\\0<\/span><span class=\"s2\">33[0m\"<\/span>\r\n  <span class=\"nb\">echo<\/span> <span class=\"nt\">-e<\/span> <span class=\"s1\">'Please exec \\033[1m`git stash list`\\033[0m command to check the stashed works detail.'<\/span>\r\n<span class=\"k\">fi<\/span>\r\n<\/code><\/pre>\n<p>\u51c6\u5907\u5de5\u4f5c\u5df2\u5b8c\u6210\u3002<\/p>\n<h2>\u4f7f\u7528\u793a\u4f8b<\/h2>\n<p>\u5728\u6267\u884cgit checkout\u547d\u4ee4\u65f6\uff0c\u6839\u636e\u662f\u5426\u5b58\u5728stash\uff0c\u5916\u89c2\u4f1a\u53d1\u751f\u4ee5\u4e0b\u53d8\u5316\u3002\u5982\u679c\u6ca1\u6709stash\uff0c\u5916\u89c2\u4e0e\u4ee5\u524d\u4e00\u6837\uff0c\u6ca1\u6709\u7279\u522b\u53d8\u5316\u3002\u5982\u679c\u5b58\u5728stash\uff0c\u5c06\u663e\u793astash\u7684\u6570\u91cf\u3002<\/p>\n<h3>\u5f53\u6682\u5b58\u54c1\u7bb1\u91cc\u6ca1\u6709\u4efb\u4f55\u4e1c\u897f\u65f6\u3002<\/h3>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d311a37434c4406c5dfe7\/31-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2020-02-14 8.46.39.png\" \/><\/div>\n<h3>\u5f53\u6709\u4e00\u4e2a\u85cf\u533f\u70b9<\/h3>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d311a37434c4406c5dfe7\/33-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2020-02-14 8.47.41.png\" \/><\/div>\n<h2>\u5fc3\u5f97<\/h2>\n<p>\u7531\u4e8egit hooks\u7684\u5e2e\u52a9\uff0c\u6211\u610f\u5916\u5730\u5f88\u5bb9\u6613\u5b9e\u73b0\u4e86\u60f3\u505a\u7684\u4e8b\u60c5\u3002\u4ec5\u4ec5\u8fd9\u6837\u6211\u76f8\u4fe1\u4f1a\u51cf\u5c11\u5f88\u591a\u672a\u56de\u9000stash\u7684\u758f\u5ffd\u3002\u5982\u679c\u4f60\u611f\u5174\u8da3\u7684\u8bdd\uff0c\u8bf7\u52a1\u5fc5\u8bd5\u4e00\u8bd5\u3002<\/p>\n<h2>\u8bf7\u53c2\u8003<\/h2>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u3010git stash\u3011\u30b3\u30df\u30c3\u30c8\u306f\u305b\u305a\u306b\u5909\u66f4\u3092\u9000\u907f\u3057\u305f\u3044\u3068\u304d &#8211; Qiita<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">Git &#8211; githooks Documentation<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5e8f\u8a00 \u4f60\u4eec\u4f7f\u7528\u8fc7git stash\u5417\uff1f\u7b80\u5355\u6765\u8bf4\uff0c\u8fd9\u662f\u4e00\u4e2a\u53ef\u4ee5\u5c06\u8fd8\u672a\u63d0\u4ea4\u6216\u6dfb\u52a0\u7684\u5de5\u4f5c\u4e2d\u7684\u66f4\u6539\u5185\u5bb9\u6682\u5b58\u8d77\u6765\u7684\u547d\u4ee4\u3002 [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-37920","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>\u4f7f\u7528 git hooks \u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d [Git] stash - 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\/\u4f7f\u7528-git-hooks-\u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d-git-stash\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528 git hooks \u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d [Git] stash\" \/>\n<meta property=\"og:description\" content=\"\u5e8f\u8a00 \u4f60\u4eec\u4f7f\u7528\u8fc7git stash\u5417\uff1f\u7b80\u5355\u6765\u8bf4\uff0c\u8fd9\u662f\u4e00\u4e2a\u53ef\u4ee5\u5c06\u8fd8\u672a\u63d0\u4ea4\u6216\u6dfb\u52a0\u7684\u5de5\u4f5c\u4e2d\u7684\u66f4\u6539\u5185\u5bb9\u6682\u5b58\u8d77\u6765\u7684\u547d\u4ee4\u3002 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528-git-hooks-\u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d-git-stash\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-12T14:35:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T06:56:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d311a37434c4406c5dfe7\/31-0.png\" \/>\n<meta name=\"author\" content=\"\u65b0, \u97f5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u65b0, \u97f5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \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\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/\",\"name\":\"\u4f7f\u7528 git hooks \u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d [Git] stash - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-11-12T14:35:06+00:00\",\"dateModified\":\"2024-04-30T06:56:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528 git hooks \u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d [Git] stash\"}]},{\"@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\/4ba4019495123db3038fd0809e6959c9\",\"name\":\"\u65b0, \u97f5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"caption\":\"\u65b0, \u97f5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528 git hooks \u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d [Git] stash - 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\/\u4f7f\u7528-git-hooks-\u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d-git-stash\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528 git hooks \u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d [Git] stash","og_description":"\u5e8f\u8a00 \u4f60\u4eec\u4f7f\u7528\u8fc7git stash\u5417\uff1f\u7b80\u5355\u6765\u8bf4\uff0c\u8fd9\u662f\u4e00\u4e2a\u53ef\u4ee5\u5c06\u8fd8\u672a\u63d0\u4ea4\u6216\u6dfb\u52a0\u7684\u5de5\u4f5c\u4e2d\u7684\u66f4\u6539\u5185\u5bb9\u6682\u5b58\u8d77\u6765\u7684\u547d\u4ee4\u3002 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528-git-hooks-\u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d-git-stash\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-11-12T14:35:06+00:00","article_modified_time":"2024-04-30T06:56:52+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d311a37434c4406c5dfe7\/31-0.png"}],"author":"\u65b0, \u97f5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u65b0, \u97f5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/","name":"\u4f7f\u7528 git hooks \u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d [Git] stash - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-11-12T14:35:06+00:00","dateModified":"2024-04-30T06:56:52+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528 git hooks \u6765\u9632\u6b62\u5fd8\u8bb0\u56de\u590d [Git] stash"}]},{"@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\/4ba4019495123db3038fd0809e6959c9","name":"\u65b0, \u97f5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","caption":"\u65b0, \u97f5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8-git-hooks-%e6%9d%a5%e9%98%b2%e6%ad%a2%e5%bf%98%e8%ae%b0%e5%9b%9e%e5%a4%8d-git-stash\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37920","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\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=37920"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37920\/revisions"}],"predecessor-version":[{"id":92589,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37920\/revisions\/92589"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=37920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=37920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=37920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}