{"id":83248,"date":"2023-11-12T15:03:10","date_gmt":"2023-11-12T07:03:10","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=83248"},"modified":"2023-11-12T15:03:10","modified_gmt":"2023-11-12T07:03:10","slug":"daily-git-commands","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/daily-git-commands.html","title":{"rendered":"\u6240\u7528\u7684\u65e5\u5e38 Git \u547d\u4ee4\uff01"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u50cf\u5927\u591a\u6570\u65b0\u624b\u4e00\u6837\uff0c\u6211\u4e00\u5f00\u59cb\u662f\u5728 StackOverflow \u4e0a\u641c\u7d22 Git \u547d\u4ee4\uff0c\u7136\u540e\u628a\u7b54\u6848\u590d\u5236\u7c98\u8d34\uff0c\u5e76\u6ca1\u6709\u771f\u6b63\u7406\u89e3\u5b83\u4eec\u7a76\u7adf\u505a\u4e86\u4ec0\u4e48\u3002
\n<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

Image credit: XKCD<\/p>\n

\u6211\u66fe\u7ecf\u60f3\u8fc7\uff1a\u201c\u5982\u679c\u6709\u4e00\u4e2a\u6700\u5e38\u89c1\u7684 Git \u547d\u4ee4\u7684\u5217\u8868\uff0c\u4ee5\u53ca\u5b83\u4eec\u7684\u529f\u80fd\u662f\u4ec0\u4e48\uff0c\u8fd9\u4e0d\u662f\u6781\u597d\u7684\u5417\uff1f\u201d
\n\u591a\u5e74\u4e4b\u540e\uff0c\u6211\u7f16\u5236\u4e86\u8fd9\u6837\u4e00\u4e2a\u5217\u8868\uff0c\u5e76\u4e14\u7ed9\u51fa\u4e86\u4e00\u4e9b\u6700\u4f73\u5b9e\u8df5\uff0c\u8ba9\u65b0\u624b\u4eec\u751a\u81f3\u4e2d\u9ad8\u7ea7\u5f00\u53d1\u4eba\u5458\u90fd\u80fd\u4ece\u4e2d\u53d1\u73b0\u6709\u7528\u7684\u4e1c\u897f\u3002<\/p>\n

\u4e3a\u4e86\u4fdd\u6301\u5b9e\u7528\u6027\uff0c\u6211\u5c06\u8fd9\u4e2a\u5217\u8868\u4e0e\u6211\u8fc7\u53bb\u4e00\u5468\u5b9e\u9645\u4f7f\u7528\u7684 Git \u547d\u4ee4\u8fdb\u884c\u4e86\u6bd4\u8f83\u3002<\/p>\n

\u51e0\u4e4e\u6bcf\u4e2a\u5f00\u53d1\u4eba\u5458\u90fd\u5728\u4f7f\u7528 Git\uff0c\u5f53\u7136\u5f88\u53ef\u80fd\u662f GitHub\u3002\u4f46\u5927\u591a\u6570\u5f00\u53d1\u8005\u5927\u6982\u6709 99\uff05 \u7684\u65f6\u95f4\u53ea\u662f\u4f7f\u7528\u8fd9\u4e09\u4e2a\u547d\u4ee4\uff1a<\/p>\n

git add --all\r\ngit commit -am \"\"\r\ngit push origin master<\/pre>\n

\u5982\u679c\u4f60\u53ea\u662f\u5355\u67aa\u5339\u9a6c\uff0c\u6216\u8005\u53c2\u52a0\u4e00\u573a\u9ed1\u5ba2\u9a6c\u62c9\u677e\u6216\u5f00\u53d1\u4e00\u6b21\u6027\u7684\u5e94\u7528\u65f6\uff0c\u5b83\u5de5\u4f5c\u5f97\u5f88\u597d\uff0c\u4f46\u662f\u5f53\u7a33\u5b9a\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u5f00\u59cb\u6210\u4e3a\u4e00\u4e2a\u4f18\u5148\u8003\u8651\u7684\u4e8b\u60c5\u540e\uff0c\u6e05\u7406\u63d0\u4ea4\u3001\u575a\u6301\u5206\u652f\u7b56\u7565\u548c\u63d0\u4ea4\u4fe1\u606f\u7684\u89c4\u8303\u6027\u5c31\u53d8\u5f97\u5f88\u91cd\u8981\u3002<\/p>\n

\u6211\u5c06\u4ece\u5e38\u7528\u547d\u4ee4\u7684\u5217\u8868\u5f00\u59cb\uff0c\u4f7f\u65b0\u624b\u66f4\u5bb9\u6613\u4e86\u89e3 Git \u80fd\u505a\u4ec0\u4e48\uff0c\u7136\u540e\u8fdb\u5165\u66f4\u9ad8\u7ea7\u7684\u529f\u80fd\u548c\u6700\u4f73\u5b9e\u8df5\u3002<\/p>\n

\u7ecf\u5e38\u4f7f\u7528\u7684\u547d\u4ee4<\/strong><\/div>\n

\u8981\u60f3\u5728\u4ed3\u5e93\u4e2d\u521d\u59cb\u5316 Git\uff0c\u4f60\u53ea\u9700\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5373\u53ef\u3002\u5982\u679c\u4f60\u6ca1\u6709\u521d\u59cb\u5316 Git\uff0c\u5219\u4e0d\u80fd\u5728\u8be5\u4ed3\u5e93\u5185\u8fd0\u884c\u4efb\u4f55\u5176\u4ed6\u7684 Git \u547d\u4ee4\u3002<\/p>\n

git init<\/pre>\n

\u5982\u679c\u4f60\u5728\u4f7f\u7528 GitHub\uff0c\u800c\u4e14\u6b63\u5728\u5c06\u4ee3\u7801\u63a8\u9001\u5230\u5728\u7ebf\u5b58\u50a8\u7684 GitHub \u4ed3\u5e93\u4e2d\uff0c\u90a3\u4e48\u4f60\u6b63\u5728\u4f7f\u7528\u7684\u5c31\u662f\u8fdc\u7a0b\u4ed3\u5e93\u3002\u8be5\u8fdc\u7a0b\u4ed3\u5e93\u7684\u9ed8\u8ba4\u540d\u79f0\uff08\u4e5f\u79f0\u4e3a\u522b\u540d\uff09\u4e3a origin\u3002\u5982\u679c\u4f60\u5df2\u7ecf\u4ece Github \u590d\u5236\u4e86\u4e00\u4e2a\u9879\u76ee\uff0c\u5b83\u5c31\u6709\u4e86\u4e00\u4e2a origin\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4 git remote -v \u67e5\u770b\u8be5 origin\uff0c\u8be5\u547d\u4ee4\u5c06\u5217\u51fa\u8fdc\u7a0b\u4ed3\u5e93\u7684 URL\u3002<\/p>\n

\u5982\u679c\u4f60\u521d\u59cb\u5316\u4e86\u81ea\u5df1\u7684 Git \u4ed3\u5e93\uff0c\u5e76\u5e0c\u671b\u5c06\u5176\u4e0e GitHub \u4ed3\u5e93\u76f8\u5173\u8054\uff0c\u5219\u5fc5\u987b\u5728 GitHub \u4e0a\u521b\u5efa\u4e00\u4e2a\uff0c\u590d\u5236\u65b0\u4ed3\u5e93\u63d0\u4f9b\u7684 URL\uff0c\u5e76\u4f7f\u7528 git remote add origin \u547d\u4ee4\uff0c\u8fd9\u91cc\u4f7f\u7528 GitHub \u63d0\u4f9b\u7684 URL \u66ff\u6362 \u3002\u8fd9\u6837\uff0c\u4f60\u5c31\u53ef\u4ee5\u6dfb\u52a0\u3001\u63d0\u4ea4\u548c\u63a8\u9001\u66f4\u6539\u5230\u4f60\u7684\u8fdc\u7a0b\u4ed3\u5e93\u4e86\u3002<\/p>\n

\u6700\u540e\u4e00\u6761\u547d\u4ee4\u7528\u5728\u5f53\u4f60\u9700\u8981\u66f4\u6539\u8fdc\u7a0b\u4ed3\u5e93\u65f6\u3002\u5982\u679c\u4f60\u4ece\u5176\u4ed6\u4eba\u90a3\u91cc\u590d\u5236\u4e86\u4e00\u4e2a\u4ed3\u5e93\uff0c\u5e76\u5e0c\u671b\u5c06\u8fdc\u7a0b\u4ed3\u5e93\u4ece\u539f\u59cb\u6240\u6709\u8005\u66f4\u6539\u4e3a\u4f60\u81ea\u5df1\u7684 GitHub \u5e10\u6237\u3002\u9664\u4e86\u6539\u7528 set-url \u6765\u66f4\u6539\u8fdc\u7a0b\u4ed3\u5e93\u5916\uff0c\u6d41\u7a0b\u4e0e git remote add origin \u76f8\u540c\u3002<\/p>\n

git remote -v\r\ngit remote add origin \r\ngit remote set-url origin<\/pre>\n

\u590d\u5236\u4ed3\u5e93\u6700\u5e38\u89c1\u7684\u65b9\u5f0f\u662f\u4f7f\u7528 git clone\uff0c\u540e\u8ddf\u4ed3\u5e93\u7684 URL\u3002<\/p>\n

\u8bf7\u8bb0\u4f4f\uff0c\u8fdc\u7a0b\u4ed3\u5e93\u5c06\u8fde\u63a5\u5230\u514b\u9686\u4ed3\u5e93\u539f\u5c5e\u4e8e\u7684\u5e10\u6237\u3002\u6240\u4ee5\uff0c\u5982\u679c\u4f60\u514b\u9686\u4e86\u4e00\u4e2a\u5c5e\u4e8e\u522b\u4eba\u7684\u4ed3\u5e93\uff0c\u4f60\u5c06\u65e0\u6cd5\u63a8\u9001\u5230 GitHub\uff0c\u9664\u975e\u4f60\u4f7f\u7528\u4e0a\u9762\u7684\u547d\u4ee4\u6539\u53d8\u4e86 origin\u3002<\/p>\n

git clone<\/pre>\n

\u4f60\u5f88\u5feb\u5c31\u4f1a\u53d1\u73b0\u81ea\u5df1\u6b63\u5728\u4f7f\u7528\u5206\u652f\u3002\u5982\u679c\u4f60\u8fd8\u4e0d\u7406\u89e3\u4ec0\u4e48\u662f\u5206\u652f\uff0c\u6709\u8bb8\u591a\u5176\u4ed6\u66f4\u6df1\u5165\u7684\u6559\u7a0b\uff0c\u4f60\u5e94\u8be5\u5148\u9605\u8bfb\u5b83\u4eec\uff0c\u518d\u7ee7\u7eed\u4e0b\u9762\u7684\u64cd\u4f5c\u3002\uff08\u8fd9\u91cc\u662f\u4e00\u4e2a\u6559\u7a0b\uff09<\/p>\n

\u547d\u4ee4 git branch \u5217\u51fa\u4e86\u672c\u5730\u673a\u5668\u4e0a\u7684\u6240\u6709\u5206\u652f\u3002\u5982\u679c\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5206\u652f\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4 git branch \uff0c\u5176\u4e2d \u8868\u793a\u5206\u652f\u7684\u540d\u5b57\uff0c\u6bd4\u5982\u8bf4 master\u3002<\/p>\n

git checkout \u547d\u4ee4\u53ef\u4ee5\u5207\u6362\u5230\u73b0\u6709\u7684\u5206\u652f\u3002\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528 git checkout -b \u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5206\u652f\u5e76\u7acb\u5373\u5207\u6362\u5230\u5b83\u3002\u5927\u591a\u6570\u4eba\u90fd\u4f7f\u7528\u6b64\u547d\u4ee4\u800c\u4e0d\u662f\u5355\u72ec\u7684 branch \u548c checkout \u547d\u4ee4\u3002<\/p>\n

git branch\r\ngit branch \r\ngit checkout \r\ngit checkout -b<\/pre>\n

\u5982\u679c\u4f60\u5bf9\u4e00\u4e2a\u5206\u652f\u8fdb\u884c\u4e86\u4e00\u7cfb\u5217\u7684\u66f4\u6539\uff0c\u5047\u5982\u8bf4\u6b64\u5206\u652f\u540d\u4e3a develop\uff0c\u5982\u679c\u60f3\u8981\u5c06\u8be5\u5206\u652f\u5408\u5e76\u56de\u4e3b\u5206\u652f\uff08master\uff09\u4e0a\uff0c\u5219\u4f7f\u7528 git merge \u547d\u4ee4\u3002\u4f60\u9700\u8981\u5148\u68c0\u51fa\uff08checkout\uff09\u4e3b\u5206\u652f\uff0c\u7136\u540e\u8fd0\u884c git merge develop \u5c06 develop \u5408\u5e76\u5230\u4e3b\u5206\u652f\u4e2d\u3002<\/p>\n

git merge<\/pre>\n

\u5982\u679c\u4f60\u6b63\u5728\u4e0e\u591a\u4e2a\u4eba\u8fdb\u884c\u534f\u4f5c\uff0c\u4f60\u4f1a\u53d1\u73b0\u6709\u65f6 GitHub \u7684\u4ed3\u5e93\u4e0a\u5df2\u7ecf\u66f4\u65b0\u4e86\uff0c\u4f46\u4f60\u7684\u672c\u5730\u5374\u6ca1\u6709\u505a\u76f8\u5e94\u7684\u66f4\u6539\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 git pull origin \u547d\u4ee4\u4ece\u8fdc\u7a0b\u5206\u652f\u4e2d\u62c9\u53d6\u6700\u65b0\u7684\u66f4\u6539\u3002<\/p>\n

git pull origin<\/pre>\n

\u5982\u679c\u60a8\u597d\u5947\u5730\u60f3\u770b\u5230\u54ea\u4e9b\u6587\u4ef6\u5df2\u88ab\u66f4\u6539\u4ee5\u53ca\u54ea\u4e9b\u5185\u5b58\u6b63\u5728\u88ab\u8ddf\u8e2a\uff0c\u53ef\u4ee5\u4f7f\u7528 git status \u547d\u4ee4\u3002\u5982\u679c\u8981\u67e5\u770b\u6bcf\u4e2a\u6587\u4ef6\u7684\u66f4\u6539\uff0c\u53ef\u4ee5\u4f7f\u7528 git diff \u6765\u67e5\u770b\u6bcf\u4e2a\u6587\u4ef6\u4e2d\u66f4\u6539\u7684\u884c\u3002<\/p>\n

git status\r\ngit diff --stat<\/pre>\n
\u9ad8\u7ea7\u547d\u4ee4\u548c\u6700\u4f73\u5b9e\u8df5<\/strong><\/div>\n

\u5f88\u5feb\u4f60\u4f1a\u5230\u8fbe\u4e00\u4e2a\u9636\u6bb5\uff0c\u8fd9\u65f6\u4f60\u5e0c\u671b\u4f60\u7684\u63d0\u4ea4\u770b\u8d77\u6765\u6574\u6d01\u4e00\u81f4\u3002\u4f60\u53ef\u80fd\u8fd8\u9700\u8981\u8c03\u6574\u4f60\u7684\u63d0\u4ea4\u8bb0\u5f55\uff0c\u4f7f\u5f97\u63d0\u4ea4\u66f4\u5bb9\u6613\u7406\u89e3\u6216\u8005\u80fd\u8fd8\u539f\u4e00\u4e2a\u610f\u5916\u7684\u6709\u7834\u574f\u6027\u7684\u66f4\u6539\u3002<\/p>\n

git log \u547d\u4ee4\u53ef\u4ee5\u8f93\u51fa\u63d0\u4ea4\u7684\u5386\u53f2\u8bb0\u5f55\u3002\u4f60\u5c06\u4f7f\u7528\u5b83\u6765\u67e5\u770b\u63d0\u4ea4\u7684\u5386\u53f2\u8bb0\u5f55\u3002<\/p>\n

\u4f60\u7684\u63d0\u4ea4\u4f1a\u9644\u5e26\u6d88\u606f\u548c\u4e00\u4e2a\u54c8\u5e0c\u503c\uff0c\u54c8\u5e0c\u503c\u662f\u4e00\u4e32\u5305\u542b\u6570\u5b57\u548c\u5b57\u6bcd\u7684\u968f\u673a\u5e8f\u5217\u3002\u4e00\u4e2a\u54c8\u5e0c\u503c\u793a\u4f8b\u5982\u4e0b\uff1ac3d882aa1aa4e3d5f18b3890132670fbeac912f7\u3002<\/p>\n

git log<\/pre>\n

\u5047\u8bbe\u4f60\u63a8\u9001\u4e86\u4e00\u4e9b\u53ef\u80fd\u7834\u574f\u4e86\u4f60\u5e94\u7528\u7a0b\u5e8f\u7684\u4e1c\u897f\u3002\u4f60\u6700\u597d\u56de\u9000\u4e00\u4e2a\u63d0\u4ea4\u7136\u540e\u518d\u63d0\u4ea4\u4e00\u6b21\u6b63\u786e\u7684\uff0c\u800c\u4e0d\u662f\u4fee\u590d\u5b83\u548c\u63a8\u9001\u65b0\u7684\u4e1c\u897f\u3002<\/p>\n

\u5982\u679c\u4f60\u5e0c\u671b\u53ca\u65f6\u56de\u9000\u5e76\u4ece\u4e4b\u524d\u7684\u63d0\u4ea4\u4e2d\u68c0\u51fa\uff08checkout\uff09\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u8be5\u54c8\u5e0c\u4f5c\u4e3a\u5206\u652f\u540d\u76f4\u63a5\u6267\u884c\u6b64\u64cd\u4f5c\u3002\u8fd9\u5c06\u4f7f\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u4e0e\u5f53\u524d\u7248\u672c\u5206\u79bb\uff08\u56e0\u4e3a\u4f60\u6b63\u5728\u7f16\u8f91\u5386\u53f2\u8bb0\u5f55\u7684\u7248\u672c\uff0c\u800c\u4e0d\u662f\u5f53\u524d\u7248\u672c\uff09\u3002<\/p>\n

git checkout c3d88eaa1aa4e4d5f<\/pre>\n

\u7136\u540e\uff0c\u5982\u679c\u4f60\u5728\u90a3\u4e2a\u5386\u53f2\u5206\u652f\u4e2d\u505a\u4e86\u66f4\u6539\uff0c\u5e76\u4e14\u60f3\u8981\u518d\u6b21\u63a8\u9001\uff0c\u4f60\u5fc5\u987b\u4f7f\u7528\u5f3a\u5236\u63a8\u9001\u3002<\/p>\n

\u6ce8\u610f\uff1a\u5f3a\u5236\u63a8\u9001\u662f\u5371\u9669\u7684\uff0c\u53ea\u6709\u5728\u7edd\u5bf9\u5fc5\u8981\u7684\u65f6\u5019\u624d\u80fd\u6267\u884c\u5b83\u3002\u5b83\u5c06\u8986\u76d6\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u7684\u5386\u53f2\u8bb0\u5f55\uff0c\u4f60\u5c06\u5931\u53bb\u4e4b\u540e\u7248\u672c\u7684\u4efb\u4f55\u4fe1\u606f\u3002<\/p>\n

git push -f origin master<\/pre>\n

\u5728\u5176\u4ed6\u65f6\u5019\uff0c\u5c06\u6240\u6709\u5185\u5bb9\u4fdd\u7559\u5728\u4e00\u4e2a\u63d0\u4ea4\u4e2d\u662f\u4e0d\u73b0\u5b9e\u7684\u3002\u4e5f\u884c\u4f60\u60f3\u5728\u5c1d\u8bd5\u6709\u6f5c\u5728\u98ce\u9669\u7684\u64cd\u4f5c\u4e4b\u524d\u4fdd\u5b58\u5f53\u524d\u8fdb\u5ea6\uff0c\u6216\u8005\u4e5f\u8bb8\u4f60\u72af\u4e86\u4e00\u4e2a\u9519\u8bef\uff0c\u4f46\u5e0c\u671b\u5728\u4f60\u7684\u7248\u672c\u5386\u53f2\u4e2d\u907f\u514d\u5c34\u5c2c\u5730\u7559\u7740\u8fd9\u4e2a\u9519\u8bef\u3002\u5bf9\u6b64\uff0c\u6211\u4eec\u6709 git rebase\u3002<\/p>\n

\u5047\u8bbe\u4f60\u5728\u672c\u5730\u5386\u53f2\u8bb0\u5f55\u4e0a\u6709 4 \u4e2a\u63d0\u4ea4\uff08\u6ca1\u6709\u63a8\u9001\u5230 GitHub\uff09\uff0c\u4f60\u8981\u56de\u9000\u8fd9\u662f\u4e2a\u63d0\u4ea4\u3002\u4f60\u7684\u63d0\u4ea4\u8bb0\u5f55\u770b\u8d77\u6765\u5f88\u4e71\u5f88\u62d6\u62c9\u3002\u8fd9\u65f6\u4f60\u53ef\u4ee5\u4f7f\u7528 rebase \u5c06\u6240\u6709\u8fd9\u4e9b\u63d0\u4ea4\u5408\u5e76\u5230\u4e00\u4e2a\u7b80\u5355\u7684\u63d0\u4ea4\u4e2d\u3002<\/p>\n

git rebase -i HEAD~4<\/pre>\n

\u4e0a\u9762\u7684\u547d\u4ee4\u4f1a\u6253\u5f00\u4f60\u8ba1\u7b97\u673a\u7684\u9ed8\u8ba4\u7f16\u8f91\u5668\uff08\u9ed8\u8ba4\u4e3a Vim\uff0c\u9664\u975e\u4f60\u5c06\u9ed8\u8ba4\u4fee\u6539\u4e3a\u5176\u4ed6\u7684\uff09\uff0c\u63d0\u4f9b\u4e86\u51e0\u4e2a\u4f60\u51c6\u5907\u5982\u4f55\u4fee\u6539\u4f60\u7684\u63d0\u4ea4\u7684\u9009\u9879\u3002\u5b83\u770b\u8d77\u6765\u5c31\u50cf\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n

pick 130deo9 oldest commit message\r\npick 4209fei second oldest commit message\r\npick 4390gne third oldest commit message\r\npick bmo0dne newest commit message<\/pre>\n

\u4e3a\u4e86\u5408\u5e76\u8fd9\u4e9b\u63d0\u4ea4\uff0c\u6211\u4eec\u9700\u8981\u5c06 pick \u9009\u9879\u4fee\u6539\u4e3a fixup\uff08\u5982\u4ee3\u7801\u4e0b\u9762\u7684\u6587\u6863\u6240\u793a\uff09\uff0c\u4ee5\u5c06\u8be5\u63d0\u4ea4\u5408\u5e76\u5e76\u4e22\u5f03\u8be5\u63d0\u4ea4\u6d88\u606f\u3002\u8bf7\u6ce8\u610f\uff0c\u5728 Vim \u4e2d\uff0c\u4f60\u9700\u8981\u6309\u4e0b a \u6216 i \u624d\u80fd\u7f16\u8f91\u6587\u672c\uff0c\u8981\u4fdd\u5b58\u9000\u51fa\uff0c\u4f60\u9700\u8981\u6309\u4e0b Esc \u952e\uff0c\u7136\u540e\u6309 shift + z + z\u3002\u4e0d\u8981\u95ee\u6211\u4e3a\u4ec0\u4e48\uff0c\u5b83\u5c31\u662f\u8fd9\u6837\u3002<\/p>\n

pick 130deo9 oldest commit message\r\nfixup 4209fei second oldest commit message\r\nfixup 4390gne third oldest commit message\r\nfixup bmo0dne newest commit message<\/pre>\n

\u8fd9\u5c06\u628a\u4f60\u7684\u6240\u6709\u63d0\u4ea4\u5408\u5e76\u5230\u4e00\u4e2a\u63d0\u4ea4\u4e2d\uff0c\u63d0\u4ea4\u6d88\u606f\u4e3a oldest commit message\u3002<\/p>\n

\u4e0b\u4e00\u6b65\u662f\u91cd\u547d\u540d\u4f60\u7684\u63d0\u4ea4\u6d88\u606f\u3002\u8fd9\u5b8c\u5168\u662f\u4e00\u4e2a\u5efa\u8bae\u7684\u64cd\u4f5c\uff0c\u4f46\u53ea\u8981\u4f60\u4e00\u76f4\u9075\u5faa\u4e00\u81f4\u7684\u6a21\u5f0f\uff0c\u90fd\u53ef\u4ee5\u505a\u5f97\u5f88\u597d\u3002\u8fd9\u91cc\u6211\u5efa\u8bae\u4f7f\u7528 Google \u4e3a Angular.js \u63d0\u4f9b\u7684\u63d0\u4ea4\u6307\u5357\u3002<\/p>\n

\u4e3a\u4e86\u66f4\u6539\u63d0\u4ea4\u6d88\u606f\uff0c\u8bf7\u4f7f\u7528 amend \u6807\u5fd7\u3002<\/p>\n

git commit --amend<\/pre>\n

\u8fd9\u4e5f\u4f1a\u6253\u5f00 Vim\uff0c\u6587\u672c\u7f16\u8f91\u548c\u4fdd\u5b58\u89c4\u5219\u5982\u4e0a\u6240\u793a\u3002\u4e3a\u4e86\u7ed9\u51fa\u4e00\u4e2a\u826f\u597d\u7684\u63d0\u4ea4\u6d88\u606f\u7684\u4f8b\u5b50\uff0c\u4e0b\u9762\u662f\u9075\u5faa\u8be5\u6307\u5357\u4e2d\u89c4\u5219\u7684\u63d0\u4ea4\u6d88\u606f\uff1a<\/p>\n

feat: add stripe checkout button to payments page\r\n- add stripe checkout button\r\n- write tests for checkout<\/pre>\n

\u4fdd\u6301\u6307\u5357\u4e2d\u5217\u51fa\u7684\u7c7b\u578b\u7684\u4e00\u4e2a\u4f18\u70b9\u662f\u5b83\u4f7f\u7f16\u5199\u66f4\u6539\u65e5\u5fd7\u66f4\u52a0\u5bb9\u6613\u3002\u4f60\u8fd8\u53ef\u4ee5\u5728\u9875\u811a\uff08\u518d\u6b21\uff0c\u5728\u6307\u5357\u4e2d\u89c4\u5b9a\u7684\uff09\u4e2d\u5305\u542b\u4fe1\u606f\u6765\u5f15\u7528\u95ee\u9898\u3002<\/p>\n

\u6ce8\u610f\uff1a\u5982\u679c\u4f60\u6b63\u5728\u534f\u4f5c\u4e00\u4e2a\u9879\u76ee\uff0c\u5e76\u5c06\u4ee3\u7801\u63a8\u9001\u5230\u4e86 GitHub\uff0c\u4f60\u5e94\u8be5\u907f\u514d\u91cd\u65b0\u5f15\u7528\uff08rebase\uff09\u5e76\u538b\u7f29\uff08squash\uff09\u4f60\u7684\u63d0\u4ea4\u3002\u5982\u679c\u4f60\u5f00\u59cb\u5728\u4eba\u4eec\u7684\u773c\u76ae\u5b50\u5e95\u4e0b\u66f4\u6539\u7248\u672c\u5386\u53f2\uff0c\u90a3\u4e48\u4f60\u53ef\u80fd\u4f1a\u9047\u5230\u96be\u4ee5\u8ffd\u8e2a\u7684\u9519\u8bef\uff0c\u4ece\u800c\u7ed9\u6bcf\u4e2a\u4eba\u90fd\u5e26\u6765\u9ebb\u70e6\u3002<\/p>\n

Git \u6709\u65e0\u6570\u7684\u547d\u4ee4\uff0c\u4f46\u8fd9\u91cc\u4ecb\u7ecd\u7684\u547d\u4ee4\u53ef\u80fd\u662f\u60a8\u6700\u521d\u51e0\u5e74\u7f16\u7a0b\u6240\u9700\u8981\u77e5\u9053\u7684\u6240\u6709\u3002<\/p>\n

Sam Corcos \u662f Sightline Maps \u7684\u9996\u5e2d\u5f00\u53d1\u5de5\u7a0b\u5e08\u548c\u8054\u5408\u521b\u59cb\u4eba\uff0cSightline Maps \u662f\u6700\u76f4\u89c2\u7684 3D \u6253\u5370\u5730\u5f62\u56fe\u7684\u5e73\u53f0\uff0c\u4ee5\u53ca\u7528\u4e8e\u6784\u5efa Phoenix \u548c React \u7684\u53ef\u6269\u5c55\u751f\u4ea7\u5e94\u7528\u7a0b\u5e8f\u7684\u4e2d\u7ea7\u9ad8\u7ea7\u6559\u7a0b\u7f51\u7ad9 LearnPhoenix.io\u3002\u4f7f\u7528\u4f18\u60e0\u7801\uff1afreecodecamp \u53d6\u5f97 LearnPhoenix \u768420\u7f8e\u5143\u3002<\/p>\n

via: https:\/\/medium.freecodecamp.org\/git-cheat-sheet-and-best-practices-c6ce5321f52<\/p>\n

\u4f5c\u8005\uff1aSam Corcos \u8bd1\u8005\uff1afirmianay \u6821\u5bf9\uff1awxy<\/p>\n

\u672c\u6587\u7531 LCTT \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd \u8363\u8a89\u63a8\u51fa<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-8841-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/daily-git-commands.html<\/a>\u7f16\u8f91\uff1a\u9ad8\u519b\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u50cf\u5927\u591a\u6570\u65b0\u624b\u4e00\u6837\uff0c\u6211\u4e00\u5f00\u59cb\u662f\u5728 StackOverflow \u4e0a\u641c\u7d22 Git \u547d\u4ee4\uff0c\u7136\u540e\u628a\u7b54\u6848\u590d\u5236\u7c98\u8d34\uff0c\u5e76 […]<\/p>\n","protected":false},"author":63,"featured_media":83263,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-83248","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/83248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=83248"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/83248\/revisions"}],"predecessor-version":[{"id":83323,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/83248\/revisions\/83323"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/83263"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=83248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=83248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=83248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}