{"id":37904,"date":"2023-09-01T01:32:24","date_gmt":"2023-12-14T00:57:23","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/"},"modified":"2024-04-30T21:02:30","modified_gmt":"2024-04-30T13:02:30","slug":"git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/","title":{"rendered":"Git\u548cGithub\u6982\u8ff0"},"content":{"rendered":"<h1>\u521b\u5efa\u5b58\u50a8\u5e93<\/h1>\n<pre class=\"post-pre\"><code>\/\/sample \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\r\n<span class=\"nb\">mkdir <\/span>sample\r\n\r\n\/\/sample\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\r\n<span class=\"nb\">cd <\/span>sample\r\n\r\n\/\/\u4eca\u3044\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092Git\u30ea\u30dd\u30b8\u30c8\u30ea\u3068\u3057\u3066\u8a2d\u5b9a\r\ngit init \r\n<\/code><\/pre>\n<p>\u203b\u7531\u4e8e.git\u662f\u4e00\u4e2a\u9690\u85cf\u6587\u4ef6\uff0c\u6240\u4ee5\u901a\u5e38\u4e0d\u4f1a\u663e\u793a\u51fa\u6765\uff0c\u4f46\u662f\u53ef\u4ee5\u901a\u8fc7\u5feb\u6377\u952e\uff1cCommand + Shift + .\uff1e\u6765\u663e\u793a\u9690\u85cf\u6587\u4ef6\u3002<\/p>\n<h1>\u786e\u8ba4\u60c5\u51b5 (Confirm the situation)<\/h1>\n<pre class=\"post-pre\"><code>\/\/\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u72b6\u614b\u3092\u78ba\u8a8d\r\ngit status\r\n\/\/\u30ea\u30dd\u30b8\u30c8\u30ea\u3068\u30d5\u30a1\u30a4\u30eb\u306e\u5dee\u5206\u3092\u30c1\u30a7\u30c3\u30af\r\ngit diff\r\n\/\/\u30ea\u30dd\u30b8\u30c8\u30ea\u3068\u30b9\u30c6\u30fc\u30b8\u306e\u5dee\u5206\u3092\u30c1\u30a7\u30c3\u30af\r\ngit diff -staged\r\n<\/code><\/pre>\n<h1>\u63d0\u4ea4<\/h1>\n<pre class=\"post-pre\"><code>\/\/\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u30b9\u30c6\u30fc\u30b8\u3059\u308b\r\ngit add \u30d5\u30a1\u30a4\u30eb\u540d\r\n\/\/\u5168\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30b9\u30c6\u30fc\u30b8\u3059\u308b\r\ngit add .\r\n\r\n\/\/\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6dfb\u3048\u3066\u30b3\u30df\u30c3\u30c8\u3059\u308b\uff08\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\uff09\r\ngit commit -m \"\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u3053\u3053\u306b\u66f8\u304f\"\r\n<\/code><\/pre>\n<p>\u5f53\u63d0\u4ea4\u65f6\uff0c\u4f1a\u8bb0\u5f55\u4e0b\u662f\u8c01\u5728\u4ec0\u4e48\u65f6\u5019\u4fee\u6539\u4e86\u4ec0\u4e48\u5185\u5bb9\uff0c\u4f46\u7531\u4e8e\u4e0d\u77e5\u9053\u4e3a\u4f55\u8fdb\u884c\u4e86\u4fee\u6539\uff0c\u56e0\u6b64\u9700\u8981\u5728\u63d0\u4ea4\u6d88\u606f\u4e2d\u5199\u4e0b\u4e3a\u4f55\u8fdb\u884c\u4e86\u4fee\u6539\u7684\u539f\u56e0\u3002<\/p>\n<h1>\u786e\u8ba4\u53d8\u66f4\u8bb0\u5f55<\/h1>\n<pre class=\"post-pre\"><code># \u5909\u66f4\u5c65\u6b74\u306e\u78ba\u8a8d\r\ngit log\r\n<\/code><\/pre>\n<h1>\u5c06\u66f4\u6539\u8fd8\u539f\u4e3a\u539f\u6837<\/h1>\n<pre class=\"post-pre\"><code>\/\/\u30ef\u30fc\u30af\u30c4\u30ea\u30fc\u306e\u5909\u66f4\u3092\u53d6\u308a\u6d88\u3059\r\ngit restore \u30d5\u30a1\u30a4\u30eb\u540d\r\n\/\/\u30b9\u30c6\u30fc\u30b8\u4e0a\u3052\u305f\u5909\u66f4\u3092\u30ef\u30fc\u30af\u30c4\u30ea\u30fc\u306b\u623b\u3059\r\ngit restore -staged \u30d5\u30a1\u30a4\u30eb\u540d\r\n<\/code><\/pre>\n<h1>\u5728\u7ed3\u8d26\u65f6\u5c06\u63d0\u4ea4\u79fb\u52a8<\/h1>\n<pre class=\"post-pre\"><code>\/\/\u6307\u5b9a\u3057\u305f\u30b3\u30df\u30c3\u30c8\u306b\u79fb\u52d5\u3059\u308b\r\ngit checkout \u30b3\u30df\u30c3\u30c8ID\r\n<\/code><\/pre>\n<h1>\u53c9\u5b50<\/h1>\n<p>\u5728Github\u4e0a\uff0cfork\u6307\u7684\u662f\u5c06\u4ed6\u4eba\u516c\u5f00\u7684\u8fdc\u7a0b\u4ed3\u5e93\u590d\u5236\u5230\u81ea\u5df1\u7684\u8fdc\u7a0b\u4ed3\u5e93\u4e2d\u3002<\/p>\n<h1>\u514b\u9686\uff08\uff09<\/h1>\n<p>\u5728Github\u4e0a\uff0c&#8221;\u30af\u30ed\u30fc\u30f3&#8221;\u6307\u7684\u662f\u5c06\u8fdc\u7a0b\u4ed3\u5e93\u590d\u5236\u5230\u81ea\u5df1\u7684\u7535\u8111\u4e0a\u4e0b\u8f7d\u3002\u70b9\u51fb&#8221;[\u2193Code]&#8221;\u6309\u94ae\uff0c\u786e\u4fdd\u9009\u62e9\u4e86&#8221;[HTTPS]&#8221;\uff0c\u7136\u540e\u590d\u5236URL\u3002<\/p>\n<pre class=\"post-pre\"><code>\/\/\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30af\u30ed\u30fc\u30f3\u3059\u308b\r\ngit clone \u81ea\u5206\u306e\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306eURL\r\n<\/code><\/pre>\n<h1>\u521b\u5efa\u4e00\u4e2a\u5206\u652f<\/h1>\n<pre class=\"post-pre\"><code>\/\/\u5b58\u5728\u3059\u308b\u30d6\u30e9\u30f3\u30c1\u3092\u4e00\u89a7\u8868\u793a\r\ngit branch\r\n\/\/\u73fe\u5728\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u5143\u306b\u3057\u3066\u3001\u65b0\u898f\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3059\u308b\r\ngit branch \u30d6\u30e9\u30f3\u30c1\u540d\r\n\/\/\u6307\u5b9a\u3057\u305f\u30d6\u30e9\u30f3\u30c1\u306b\u79fb\u52d5\u3059\u308b\r\ngit checkout \u30d6\u30e9\u30f3\u30c1\u540d\r\n\r\n\/\/\u4e00\u3064\u306e\u30b3\u30de\u30f3\u30c9\u3067\u65b0\u898f\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3057\u3066\u3001\u4f5c\u6210\u3057\u305f\u30d6\u30e9\u30f3\u30c1\u306b\u79fb\u52d5\u3059\u308b\r\ngit checkout -b \u30d6\u30e9\u30f3\u30c1\u540d\r\n<\/code><\/pre>\n<h1>\u521b\u5efa\u5206\u652f\u5e76\u63d0\u4ea4\u63d0\u4ea4<\/h1>\n<pre class=\"post-pre\"><code>\/\/profile\u30d6\u30e9\u30f3\u30c1\u3092\u65b0\u898f\u4f5c\u6210\u3057\u3066\u3001profile\u30d6\u30e9\u30f3\u30c1\u306b\u79fb\u52d5\u3059\u308b\r\ngit checkout -b profile\r\n\/\/member.html\u3092\u30b9\u30c6\u30fc\u30b8\u3059\u308b\r\ngit add member.html\r\n\/\/\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6dfb\u3048\u3066\u30b3\u30df\u30c3\u30c8\u3059\u308b(\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8)\r\ngit commit -m \"\u65b0\u305f\u306b\u7d39\u4ecb\u6587\u3092\u8ffd\u52a0\"\r\n\/\/master\u30d6\u30e9\u30f3\u30c1\u306b\u79fb\u52d5\u3059\u308b\r\ngit checkout master\r\n<\/code><\/pre>\n<h1>\u5408\u5e76\u5206\u652f (\u5408\u5e76)<\/h1>\n<p>\u5408\u5e76\u662f\u5c06\u81ea\u5df1\u4fee\u6539\u7684\u4ee3\u7801\u4e0e\u6b63\u5f0f\u7684\u4e3b\u5206\u652f(master)\u5408\u5e76\u7684\u8fc7\u7a0b\u3002<\/p>\n<pre class=\"post-pre\"><code>\/\/\u30de\u30fc\u30b8\u30b3\u30df\u30c3\u30c8\u3092\u4f5c\u308a\u305f\u3044\u30d6\u30e9\u30f3\u30c1A\uff08master\uff09\u306b\u79fb\u52d5\u3059\u308b\r\ngit checkout \u30d6\u30e9\u30f3\u30c1A\r\n\/\/\u30de\u30fc\u30b8\u3057\u305f\u3044\u30d6\u30e9\u30f3\u30c1B\u3092\u6307\u5b9a\u3057\u3066\u30de\u30fc\u30b8\u3059\u308b\r\ngit merge \u30d6\u30e9\u30f3\u30c1B\r\n<\/code><\/pre>\n<p>\u5982\u679c\u4ee5\u524d\u7684\u4f8b\u5b50\u4e3a\u4f8b\uff0c\u5206\u652fA\u662f\u4e3b\u5206\u652f\uff0c\u5206\u652fB\u662f\u4e2a\u4eba\u8d44\u6599\u5206\u652f\u3002<\/p>\n<h1>\u63a8\u9001\u6240\u6307\u7684\u662f<br \/>\nh\u00e9 sh\u01d0 de sh\u00ec)<\/h1>\n<p>\u63a8\u9001\u662f\u6307\u5c06\u672c\u5730\u4ed3\u5e93\u53d1\u751f\u7684\u53d8\u5316\u53cd\u6620\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff08\u4e0a\u4f20\uff09\u7684\u8fc7\u7a0b\u3002<\/p>\n<pre class=\"post-pre\"><code>\/\/\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u3067\u884c\u3063\u305f\u5909\u66f4\u3092\u3001\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30d7\u30c3\u30b7\u30e5\u3059\u308b\r\ngit push \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u540d\u3000\u30d6\u30e9\u30f3\u30c1\u540d\r\n\/\/\u203b\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u540d\u304corigin\u3001\u30d6\u30e9\u30f3\u30c1\u540d\u304cmaster\u306e\u3068\u304d\r\ngit push origin master\r\n<\/code><\/pre>\n<h1>&#8220;\u30d7\u30eb&#8221; \u662f\u4ec0\u4e48\uff1f<\/h1>\n<p>\u5c06\u8fdc\u7a0b\u4ed3\u5e93\u4e2d\u53d1\u751f\u7684\u66f4\u6539\u540c\u6b65\u5230\u672c\u5730\u4ed3\u5e93\u3002<\/p>\n<pre class=\"post-pre\"><code>\/\/\u30d7\u30eb\u3057\u3066\u304d\u305f\u3044\u30d6\u30e9\u30f3\u30c1\u306b\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3059\u308b\r\ngit checkout \u30d6\u30e9\u30f3\u30c1\u540d\r\n\/\/\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u4e0a\u306e\u30b3\u30df\u30c3\u30c8\u3092\u3001\u30ed\u30fc\u30ab\u30eb\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u73fe\u5728\u306e\u30d6\u30e9\u30f3\u30c1\u306b\u53d6\u308a\u8fbc\u3080\r\ngit pull \u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u540d \u30d6\u30e9\u30f3\u30c1\u540d\r\n\/\/\u203b\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u540d\u304corigin\u3067\u3001\u30d6\u30e9\u30f3\u30c1\u540d\u304cmaster\u306e\u3068\u304d \r\ngit pull origin master\r\n<\/code><\/pre>\n<h1>\u5904\u7406\u51b2\u7a81\u7684\u65b9\u6cd5 de<\/h1>\n<p>\u5f53\u5728\u540c\u4e00\u884c\u4e0a\u540c\u65f6\u8fdb\u884c\u4e0d\u540c\u7684\u4fee\u6539\u65f6\uff0c\u5c31\u4f1a\u53d1\u751f\u51b2\u7a81bug\u3002<br \/>\n\u4e3a\u4e86\u65e0\u6cd5\u786e\u5b9a\u5e94\u8be5\u91c7\u7528\u54ea\u4e2a\u4fee\u6b63\u800c\u53d1\u751f\u51b2\u7a81\u3002<br \/>\n\u5728\u7f16\u8f91\u5668\u4e2d\u76f4\u63a5\u7f16\u8f91\u4fdd\u5b58\u51b2\u7a81\u7684\u90e8\u5206\uff0c\u7136\u540e\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<pre class=\"post-pre\"><code>\/\/\u4fee\u6b63\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u30b9\u30c6\u30fc\u30b8\u3059\u308b\r\ngit add \u30d5\u30a1\u30a4\u30eb\u540d\r\n\/\/\u666e\u901a\u306b\u30b3\u30df\u30c3\u30c8\u3059\u308b\r\ngit commit -m \"\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\"\r\n\r\n\/\/\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u306e\u7b87\u6240\u304c\u591a\u3059\u304e\u3066\u4fee\u6b63\u304c\u96e3\u3057\u3044\u5834\u5408\u3001\u30b3\u30df\u30c3\u30c8\u524d\u3067\u8352\u308c\u305f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u30de\u30fc\u30b8\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3067\u304d\u308b\r\ngit merge --abort\r\n<\/code><\/pre>\n<h1>\u300c\u30d7\u30eb\u30ea\u30af\u30a8\u30b9\u30c8\u300d\u3068\u306f\u4ec0\u4e48\u610f\u601d<\/h1>\n<p>&#8220;Pull Request&#8221; \u662f\u6307\u5c06\u81ea\u5df1\u6240\u505a\u7684\u66f4\u6539\u5efa\u8bae\u5408\u5e76\u5230\u5df2\u7ecf\u5206\u79bb\u51fa\u6765\u7684\u539f\u59cb\u4ee3\u7801\u5e93\u4e2d\u3002<br \/>\nPull Request \u7684\u76ee\u7684\u662f\u5c06\u66f4\u6539\u5408\u5e76\u5230\u4e3b\u5206\u652f\u4e2d\u3002<\/p>\n<h2>\u8bf7\u63cf\u8ff0\u4ee5\u4e0b\u7684\u5de5\u4f5c\u6d41\u7a0b\uff08\u4ece\u521b\u5efa\uff09Pull Request \u5230\u5408\u5e76\u7684\u8fc7\u7a0b\u3002<\/h2>\n<p>1. \u5728GitHub\u4e0a\u70b9\u51fb[Fork]\u6309\u94ae\uff0c\u5c06\u5176\u590d\u5236\u5230\u81ea\u5df1\u7684\u8fdc\u7a0b\u4ed3\u5e93\u4e2d\u3002<br \/>\n2. \u8fdb\u884c\u514b\u9686\u64cd\u4f5c\u3002<\/p>\n<pre class=\"post-pre\"><code>\/\/\u6307\u5b9a\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30af\u30ed\u30fc\u30f3\u3059\u308b\r\ngit clone \u30ea\u30dd\u30b8\u30c8\u30eaURL\r\n\/\/\u30af\u30ed\u30fc\u30f3\u3067\u4f5c\u6210\u3055\u308c\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\r\ncd \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\r\n<\/code><\/pre>\n<p>\u521b\u5efa\u5e76\u63d0\u4ea4\u4e00\u4e2a\u5206\u652f<\/p>\n<pre class=\"post-pre\"><code>\/\/\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u3063\u3066\u305d\u306e\u30d6\u30e9\u30f3\u30c1\u306b\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3059\u308b\r\ngit checkout -b \u30d6\u30e9\u30f3\u30c1\u540d\r\n\/\/\u30b3\u30df\u30c3\u30c8\u3059\u308b\r\ngit add \u30d5\u30a1\u30a4\u30eb\u540d\r\ngit commit -m \"\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\"\r\n<\/code><\/pre>\n<p>\u63a8\u9001<\/p>\n<pre class=\"post-pre\"><code>git push origin \u30d6\u30e9\u30f3\u30c1\u540d\r\n<\/code><\/pre>\n<p>\u5728GitHub\u4e0a\u521b\u5efa\u62c9\u53d6\u8bf7\u6c42<\/p>\n<p>\u5728GitHub\u4e0a\uff0c\u66f4\u65b0fork\u7684\u5b58\u50a8\u5e93\u9996\u9875\u65f6\uff0c\u5c4f\u5e55\u9876\u90e8\u4f1a\u663e\u793a\u201cPull request\u201d\u548c\u201cCompare\u201d\u9009\u9879\u3002<br \/>\n\u70b9\u51fb\u6253\u5f00Compare\u9875\u9762\u540e\uff0c\u5982\u679c\u6ca1\u6709\u95ee\u9898\uff0c\u53ef\u4ee5\u6bd4\u8f83\u201cmaster\u5206\u652f\u548c\u81ea\u5df1\u7684\u5b58\u50a8\u5e93\u5206\u652f\u201d\u7684\u5dee\u5f02\uff0c\u5e76\u67e5\u770b\u6bcf\u884c\u4ee3\u7801\u7684\u5177\u4f53\u53d8\u52a8\u60c5\u51b5\uff0c\u7136\u540e\u70b9\u51fb\u201cCreate Pull request\u201d\u6309\u94ae\u3002<\/p>\n<p>6. \u88ab\u5408\u5e76<\/p>\n<p>\u5f53Fork\u7684\u539f\u59cb\u4f5c\u8005\u786e\u8ba4\u5185\u5bb9\u540e\uff0c\u70b9\u51fb[\u5408\u5e76\u62c9\u53d6\u8bf7\u6c42]\u6309\u94ae\u5373\u53ef\u8fdb\u884c\u5408\u5e76\u3002<\/p>\n<h1>\u5ffd\u7565\u4e0d\u9700\u8981\u8fdb\u884c\u7248\u672c\u7ba1\u7406\u7684\u6587\u4ef6\u3002<\/h1>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">OS\u304c\u81ea\u52d5\u751f\u6210\u3059\u308b\u30d5\u30a1\u30a4\u30eb<\/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\">\u30ad\u30e3\u30c3\u30b7\u30e5<\/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\">\u5bb9\u91cf\u304c\u5927\u304d\u3059\u304e\u308b\u3082\u306e<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u305d\u306e\u3088\u3046\u306a\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u304c\u5fc5\u8981\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u306f .gitignore \u3068\u3044\u3046\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u3063\u3066Git\u7ba1\u7406\u3057\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3067\u304d\u308b\u3002<\/ul>\n<p>\u4ee5\u4e0b\u7684\u6587\u4ef6\u540d\u4e0d\u5305\u62ec\u5728\u5185\uff08\u4f8b\u5982\uff09<\/p>\n<div>\n<div class=\"post-table\">\u30d5\u30a1\u30a4\u30eb\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u8aac\u660e.DS_StoremacOS\u304c\u81ea\u52d5\u751f\u6210\u3059\u308b\u3082\u306eThumbs.dbWindows OS\u304c\u81ea\u52d5\u751f\u6210\u3059\u308b\u3082\u306e.sass-cache\/Saas\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3002\u7ba1\u7406\u304c\u5fc5\u8981\u306a\u3044\u305f\u3081\u3001\u9664\u5916\u3059\u308b*.css.mapSass\u306e\u30bd\u30fc\u30b9\u30de\u30c3\u30d7\u3002Sass\u306e\u9069\u7528\u7b87\u6240\u3092\u8fbf\u308b\u305f\u3081\u306b\u51fa\u529b\u3059\u308b\u3082\u306e\u3002\u7ba1\u7406\u304c\u5fc5\u8981\u306a\u3044\u305f\u3081\u3001\u9664\u5916\u3059\u308b<\/div>\n<\/div>\n<h2>.gitignore\u6587\u4ef6\u7684\u64b0\u5199\u65b9\u6cd5<\/h2>\n<pre class=\"post-pre\"><code>\/\/ \u81ea\u5206\u7528\u306e\u30e1\u30e2\u30d5\u30a1\u30a4\u30eb\u3092\u7121\u8996\u3059\u308b\r\nmemo.txt\r\n\/\/\u3000.rbc\u3068\u3044\u3046\u62e1\u5f35\u5b50\u304c\u3064\u3044\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u7121\u8996\r\n*.rbc\r\n\/\/\u4f8b\u5916\u3068\u3057\u3066\u3001text.rbc\u306f\u7121\u8996\u3057\u306a\u3044\r\n!test.rbc\r\n\/\/\u7279\u5b9a\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d(config_c)\u4ee5\u4e0b\u3092\u7121\u8996\r\nconfig_c\/\r\n\/\/\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u76f4\u4e0b\u306b\u3042\u308b\u3082\u306e\u3092\u6307\u5b9a\u3059\u308b\r\n\/\/\u203b\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3042\u308blog\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u3092\u7121\u8996\u3059\u308b\u3068\u304d\r\n\/log\/\r\n<\/code><\/pre>\n<h2>\u5c06.gitignore\u6587\u4ef6\u63d0\u4ea4<\/h2>\n<pre class=\"post-pre\"><code>\/\/.gitignore\u30d5\u30a1\u30a4\u30eb\u3092\u30b9\u30c6\u30fc\u30b8\u3059\u308b\r\ngit add .gitignore\r\n\/\/.gitignore\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30df\u30c3\u30c8\u3059\u308b\r\ngit commit -m \"add file to .gitignore\"\r\n\/\/.gitignore\u306b .DS_Store\u3092\u8ffd\u52a0\u7de8\u96c6\u3059\u308b\r\necho .DS_Store &gt;&gt; .gitignore\r\n<\/code><\/pre>\n<h1>\u5f53\u6211\u4e0d\u5c0f\u5fc3\u63d0\u4ea4\u4e86\u4e00\u4e9b\u591a\u4f59\u7684\u6587\u4ef6\u5e76\u5e0c\u671b\u5ffd\u7565\u5b83\u4eec\u7684\u65f6\u5019\u3002<\/h1>\n<h2>\u5728\u672a\u6765\u7684\u7ba1\u7406\u4e2d\u5c06\u76ee\u6807\u6587\u4ef6\u6392\u9664<\/h2>\n<pre class=\"post-pre\"><code>\/\/git\u306e\u7ba1\u7406\u304b\u3089\u524a\u9664\r\ngit rm --cached &lt;\u30d5\u30a1\u30a4\u30eb\u540d&gt;\r\n\/\/gitignore\u30d5\u30a1\u30a4\u30eb\u5185\u306b\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u8a18\u5165\r\necho '&lt;\u30d5\u30a1\u30a4\u30eb\u540d&gt;'\u3000&gt;&gt; .gitignore\r\n<\/code><\/pre>\n<h2>\u4ece\u6587\u4ef6\u5386\u53f2\u4e2d\u5220\u9664<\/h2>\n<pre class=\"post-pre\"><code>git filter -branch -f --index-filter 'git rm --cached -rf --ignore -unmatch &lt;\u30d5\u30a1\u30a4\u30eb\u540d&gt;' HEAD\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u521b\u5efa\u5b58\u50a8\u5e93 \/\/sample \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210 mkdir sample \/\/sample\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-37904","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\u548cGithub\u6982\u8ff0 - 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\u548cgithub\u6982\u8ff0-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Git\u548cGithub\u6982\u8ff0\" \/>\n<meta property=\"og:description\" content=\"\u521b\u5efa\u5b58\u50a8\u5e93 \/\/sample \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210 mkdir sample \/\/sample\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/git\u548cgithub\u6982\u8ff0-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-14T00:57:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T13:02:30+00:00\" \/>\n<meta name=\"author\" content=\"\u97f5, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u97f5, \u79d1\" \/>\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\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/\",\"name\":\"Git\u548cGithub\u6982\u8ff0 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-12-14T00:57:23+00:00\",\"dateModified\":\"2024-04-30T13:02:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Git\u548cGithub\u6982\u8ff0\"}]},{\"@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\/6530331a63adef3b3443a1fab53a0e6e\",\"name\":\"\u97f5, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"caption\":\"\u97f5, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Git\u548cGithub\u6982\u8ff0 - 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\u548cgithub\u6982\u8ff0-2\/","og_locale":"zh_CN","og_type":"article","og_title":"Git\u548cGithub\u6982\u8ff0","og_description":"\u521b\u5efa\u5b58\u50a8\u5e93 \/\/sample \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210 mkdir sample \/\/sample\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/git\u548cgithub\u6982\u8ff0-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-12-14T00:57:23+00:00","article_modified_time":"2024-04-30T13:02:30+00:00","author":"\u97f5, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u97f5, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/","name":"Git\u548cGithub\u6982\u8ff0 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-12-14T00:57:23+00:00","dateModified":"2024-04-30T13:02:30+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"Git\u548cGithub\u6982\u8ff0"}]},{"@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\/6530331a63adef3b3443a1fab53a0e6e","name":"\u97f5, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","caption":"\u97f5, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/git%e5%92%8cgithub%e6%a6%82%e8%bf%b0-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\/37904","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\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=37904"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37904\/revisions"}],"predecessor-version":[{"id":94280,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/37904\/revisions\/94280"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=37904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=37904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=37904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}