{"id":231984,"date":"2023-01-11T10:03:00","date_gmt":"2023-01-11T07:03:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=231984"},"modified":"2022-11-10T07:07:22","modified_gmt":"2022-11-10T04:07:22","slug":"jak-vikoristovuvati-perehopljuvachi-git-dlja-vijavlennja-zmin-u-fajli-blokuvannja-ta-pokazu-povidomlennja","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/uk\/jak-vikoristovuvati-perehopljuvachi-git-dlja-vijavlennja-zmin-u-fajli-blokuvannja-ta-pokazu-povidomlennja\/","title":{"rendered":"\u042f\u043a \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u043f\u043b\u044e\u0432\u0430\u0447\u0456 Git \u0434\u043b\u044f \u0432\u0438\u044f\u0432\u043b\u0435\u043d\u043d\u044f \u0437\u043c\u0456\u043d \u0443 \u0444\u0430\u0439\u043b\u0456 \u0431\u043b\u043e\u043a\u0443\u0432\u0430\u043d\u043d\u044f \u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u0443 \u043f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f"},"content":{"rendered":"\n<p>\u041a\u043e\u043b\u0438 \u043c\u0438 \u043f\u0440\u0430\u0446\u044e\u0454\u043c\u043e \u043d\u0430\u0434 \u0441\u043f\u0456\u043b\u044c\u043d\u043e\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u044e, \u0447\u0430\u0441 \u0432\u0456\u0434 \u0447\u0430\u0441\u0443 \u0440\u043e\u0437\u0440\u043e\u0431\u043d\u0438\u043a\u0443 \u0434\u043e\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0434\u043e\u0434\u0430\u0432\u0430\u0442\u0438 \u043d\u043e\u0432\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 \u0434\u043e \u0433\u0456\u043b\u043a\u0438, \u044f\u043a\u0438\u0439 \u043f\u043e\u0442\u0456\u043c \u043e\u0431&#8217;\u0454\u0434\u043d\u0443\u0454\u0442\u044c\u0441\u044f \u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u0438\u043c. \u0425\u0442\u043e\u0441\u044c \u043c\u043e\u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u0442\u0438 \u043f\u0440\u043e \u0446\u0435 \u0442\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0438\u0442\u044f\u0433\u043d\u0443\u0442\u0438 \u043c\u0430\u0439\u0441\u0442\u0435\u0440 \u0456 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0443 \u043b\u0438\u0448\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0449\u043e\u0431 \u0432\u043e\u043d\u0430 \u0432\u0438\u0439\u0448\u043b\u0430 \u0437 \u043b\u0430\u0434\u0443 \u0447\u0435\u0440\u0435\u0437 \u0432\u0456\u0434\u0441\u0443\u0442\u043d\u0456\u0441\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0438\u0432\u0438\u043c\u043e\u0441\u044f, \u044f\u043a \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u043f\u043b\u044e\u0432\u0430\u0447\u0456 Git \u0434\u043b\u044f \u0432\u0438\u044f\u0432\u043b\u0435\u043d\u043d\u044f \u0437\u043c\u0456\u043d \u0443 a <code>package.json<\/code>\u0430\u0431\u043e a <code>yarn.lock<\/code>\u0442\u0430 \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u043f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f, \u044f\u043a\u0435 \u043f\u0440\u043e\u043f\u043e\u043d\u0443\u0454 \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0435\u0432\u0456 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438 \u0432\u0456\u0434\u0441\u0443\u0442\u043d\u0456 \u0437\u0430\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u0456.<\/p>\n<h2>\u0429\u043e \u0442\u0430\u043a\u0435 \u0445\u0443\u043a\u0438 Git?<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u043f\u043b\u044e\u0432\u0430\u0447\u0456 Git \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u044c\u0441\u044f, \u043a\u043e\u043b\u0438 \u0432\u0456\u0434\u0431\u0443\u0432\u0430\u0454\u0442\u044c\u0441\u044f \u044f\u043a\u0430\u0441\u044c \u043f\u043e\u0434\u0456\u044f Git, \u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434 \u043d\u043e\u0432\u0438\u0439 \u043a\u043e\u043c\u043c\u0456\u0442, \u043d\u0430\u0434\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043a\u043e\u043c\u0456\u0442\u0456\u0432 \u0434\u043e \u043e\u043d\u043b\u0430\u0439\u043d-\u0433\u0456\u043b\u043a\u0438, \u0432\u0438\u0442\u044f\u0433\u0443\u0432\u0430\u043d\u043d\u044f \u043a\u043e\u043c\u0456\u0442\u0456\u0432, \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0430 \u0433\u0456\u043b\u043a\u0438 \u0430\u0431\u043e \u043e\u0431\u2019\u0454\u0434\u043d\u0430\u043d\u043d\u044f \u0433\u0456\u043b\u043a\u0438. \u0426\u0456 \u043f\u0440\u043e\u0446\u0435\u0441\u0438 \u0437\u0430\u043a\u0456\u043d\u0447\u0443\u044e\u0442\u044c\u0441\u044f 0, \u044f\u043a\u0449\u043e \u0432\u043e\u043d\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0443\u044e\u0442\u044c\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0430\u0431\u043e \u0456\u043d\u0448\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f\u043c, \u044f\u043a\u0449\u043e \u0432\u043e\u043d\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0443\u044e\u0442\u044c\u0441\u044f \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>\u042f\u043a\u0449\u043e \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441 \u0437\u0430\u043a\u0456\u043d\u0447\u0443\u0454\u0442\u044c\u0441\u044f 0, \u0434\u0456\u044f Git \u043f\u0440\u043e\u0434\u043e\u0432\u0436\u0443\u0454\u0442\u044c\u0441\u044f. \u0406\u043d\u0430\u043a\u0448\u0435 \u0434\u0456\u044e Git \u0431\u043b\u043e\u043a\u0443\u0454\u0442\u044c\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u044f\u043a\u0449\u043e \u0432\u0438 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0454\u0442\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u043f\u043b\u044e\u0432\u0430\u0447 Git \u043f\u0435\u0440\u0435\u0434 \u0444\u0456\u043a\u0441\u0430\u0446\u0456\u0454\u044e \u0434\u043b\u044f \u043b\u0456\u043d\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0432\u0430\u0448\u043e\u0433\u043e \u043a\u043e\u0434\u0443, Git \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0446\u0435, \u043a\u043e\u043b\u0438 \u0432\u0438 \u0437\u0440\u043e\u0431\u0438\u0442\u0435 <code>git commit<\/code>. \u042f\u043a\u0449\u043e lint \u0432\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u0437 \u043b\u0430\u0434\u0443, \u0444\u0456\u043a\u0441\u0430\u0446\u0456\u044f \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0435.<\/p>\n<p>\u0425\u0443\u043a\u0438 Git \u2014 \u0446\u0435 \u0442\u0435, \u0449\u043e \u0456\u043d\u0442\u0435\u0433\u0440\u043e\u0432\u0430\u043d\u043e \u0432 Git, \u0456 \u0441\u043f\u0438\u0441\u043e\u043a \u0445\u0443\u043a\u0456\u0432 \u0434\u0443\u0436\u0435 \u0432\u0435\u043b\u0438\u043a\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0443 \u0432\u0430\u0441 \u0454 <a href=\"https:\/\/www.git-scm.com\/docs\/githooks#_pre_push\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">pre-push<\/a>, <a href=\"https:\/\/www.git-scm.com\/docs\/githooks#_post_commit\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">post-commit<\/a>, <a href=\"https:\/\/www.git-scm.com\/docs\/githooks#_post_checkout\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">post-checkout<\/a>, <a href=\"https:\/\/www.git-scm.com\/docs\/githooks#_post_merge\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">post-merge<\/a> \u0442\u0430 \u0431\u0430\u0433\u0430\u0442\u043e \u0456\u043d\u0448\u0438\u0445 <a href=\"https:\/\/www.git-scm.com\/docs\/githooks\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0433\u0456\u043a\u0456\u0432 Git<\/a>.<\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0439\u0442\u0435 \u0445\u0443\u043a\u0438 Git \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e Husky<\/h2>\n<p>\u0429\u043e\u0431 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u0434\u0435\u044f\u043a\u0456 \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f, \u043a\u043e\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u044c\u0441\u044f \u0445\u0443\u043a\u0438 Git, \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043a\u0435\u0442 <a href=\"https:\/\/github.com\/typicode\/husky\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">Husky<\/a> \u0434\u043b\u044f <a href=\"https:\/\/startfunction.com\/tag\/node-js\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">Node.js.<\/a> Husky \u0434\u043e\u0437\u0432\u043e\u043b\u044f\u0454 \u043d\u0430\u043c \u0432\u043a\u0430\u0437\u0430\u0442\u0438 \u0443 <code>package.json<\/code>\u0444\u0430\u0439\u043b\u0456, \u044f\u043a\u0456 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u0457 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u0438, \u043a\u043e\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u043f\u043b\u0435\u043d\u043d\u044f Git. \u0412\u0441\u0442\u0430\u043d\u043e\u0432\u0456\u0442\u044c \u043f\u0430\u043a\u0435\u0442 Husky \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e NPM:<\/p>\n<pre><code>npm i -D husky<\/code><\/pre>\n<p>\u0430\u0431\u043e \u043f\u0440\u044f\u0436\u0430:<\/p>\n<pre><code>yarn add -D husky<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0456\u043d\u0456\u0446\u0456\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u0442\u0438 Husky \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u043f\u043b\u044e\u0432\u0430\u0447\u0456\u0432 Git. \u042f\u043a\u0449\u043e \u0432\u0438 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u0442\u0435 NPM:<\/p>\n<pre><code>npx husky install<\/code><\/pre>\n<p>\u0456 \u044f\u043a\u0449\u043e \u0432\u0438 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u0442\u0435 Yarn<\/p>\n<pre><code>yarn husky install<\/code><\/pre>\n<p>\u0456 \u0432\u0441\u0435, \u0442\u0435\u043f\u0435\u0440 \u0432\u0438 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0442\u0430 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043b\u0438 Husky \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u043f\u043b\u044e\u0432\u0430\u0447\u0456\u0432 Git. \u041d\u0430\u0440\u0435\u0448\u0442\u0456 \u043d\u0430\u0441\u0442\u0430\u0432 \u0447\u0430\u0441 \u0432\u0438\u0437\u043d\u0430\u0447\u0438\u0442\u0438 \u0433\u0430\u0447\u043e\u043a!<\/p>\n<h2>\u0414\u043e\u0434\u0430\u0439\u0442\u0435 \u0441\u043f\u043e\u0432\u0456\u0449\u0435\u043d\u043d\u044f Git \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0438 \u0437\u043c\u0456\u043d \u0443 \u0444\u0430\u0439\u043b\u0456 \u0431\u043b\u043e\u043a\u0443\u0432\u0430\u043d\u043d\u044f<\/h2>\n<p>\u041c\u0438 \u0445\u043e\u0447\u0435\u043c\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u044f\u043a\u0438\u0439\u0441\u044c \u043a\u043e\u0434, \u0449\u043e\u0431 \u0441\u043f\u043e\u0432\u0456\u0441\u0442\u0438\u0442\u0438 \u043d\u0430\u0441, \u044f\u043a\u0449\u043e \u0444\u0430\u0439\u043b\u0438 <code>package-lock.json<\/code>\u0430\u0431\u043e <code>yarn.lock<\/code>\u0437\u043c\u0456\u043d\u0438\u043b\u0438\u0441\u044f. \u0417\u0430\u0437\u0432\u0438\u0447\u0430\u0439 \u0446\u0435 \u0442\u0440\u0430\u043f\u043b\u044f\u0454\u0442\u044c\u0441\u044f, \u043a\u043e\u043b\u0438 \u043c\u0438 \u0432\u0438\u0442\u044f\u0433\u0443\u0454\u043c\u043e <code>master<\/code>\u0456 \u0446\u0456 \u0444\u0430\u0439\u043b\u0438 \u0437\u043c\u0456\u043d\u044e\u044e\u0442\u044c\u0441\u044f. \u041c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u0442\u0438 \u0445\u0443\u043a \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0443, \u043a\u043e\u043b\u0438 \u043c\u0438 \u043e\u0431\u2019\u0454\u0434\u043d\u0443\u0454\u043c\u043e \u0433\u0456\u043b\u043a\u0443.<\/p>\n<p>\u0429\u043e\u0431 \u0432\u0438\u0437\u043d\u0430\u0447\u0438\u0442\u0438 \u043d\u0430\u0448\u0456 \u0445\u0443\u043a\u0438 Git \u0434\u043b\u044f Husky, \u043c\u0438 \u0432\u0438\u0437\u043d\u0430\u0447\u0430\u0454\u043c\u043e \u0457\u0445 \u0443 <code>package.json<\/code>\u0444\u0430\u0439\u043b\u0456. \u0414\u043e\u0434\u0430\u0439\u0442\u0435 \u0446\u0435 \u044f\u043a \u043a\u043b\u044e\u0447 \u0432\u0435\u0440\u0445\u043d\u044c\u043e\u0433\u043e \u0440\u0456\u0432\u043d\u044f:<\/p>\n<pre><code>\"husky\": {\n    \"hooks\": {\n      \"post-merge\": \".\/githooks\/post-merge-hook.sh\"\n    }\n}<\/code><\/pre>\n<p>\u0426\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e \u0442\u0435, \u0449\u043e \u043f\u0456\u0441\u043b\u044f \u043e\u0431\u2019\u0454\u0434\u043d\u0430\u043d\u043d\u044f \u0433\u0456\u043b\u043a\u0438 \u043c\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0446\u0435\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u0439. \u0422\u0435\u043f\u0435\u0440 \u043c\u0438 \u043c\u0430\u0454\u043c\u043e \u0439\u043e\u0433\u043e \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438. \u0421\u0442\u0432\u043e\u0440\u0456\u0442\u044c \u043f\u0430\u043f\u043a\u0443, \u0434\u043e\u0434\u0430\u0439\u0442\u0435 \u0434\u043e \u043d\u0435\u0457 \u0444\u0430\u0439\u043b \u0456 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0439\u0442\u0435 \u0439\u043e\u0433\u043e \u044f\u043a \u0432\u0438\u043a\u043e\u043d\u0443\u0432\u0430\u043d\u0438\u0439:<\/p>\n<pre><code>mkdir githooks &amp;&amp; cd githooks &amp;&amp; touch post-merge-hook.sh &amp;&amp; chmod +x post-merge-hook.sh<\/code><\/pre>\n<p>\u042f\u043a\u0449\u043e \u0432\u0438 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0454\u0442\u0435 \u0439\u043e\u0433\u043e \u044f\u043a \u0432\u0438\u043a\u043e\u043d\u0443\u0432\u0430\u043d\u0438\u0439, \u0432\u0438 \u0437\u0456\u0442\u043a\u043d\u0435\u0442\u0435\u0441\u044f \u0437 \u043f\u043e\u043c\u0438\u043b\u043a\u043e\u044e \u00ab\u0423 \u0434\u043e\u0437\u0432\u043e\u043b\u0456 \u0432\u0456\u0434\u043c\u043e\u0432\u043b\u0435\u043d\u043e\u00bb, \u043a\u043e\u043b\u0438 Husky \u0441\u043f\u0440\u043e\u0431\u0443\u0454 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u0446\u0435\u0439 \u043f\u0456\u0434\u0445\u043e\u043f\u043b\u044e\u0432\u0430\u0447 Git. \u0422\u0435\u043f\u0435\u0440 \u0432\u0456\u0434\u0440\u0435\u0434\u0430\u0433\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e Vim \u0430\u0431\u043e \u0432\u0430\u0448\u043e\u0433\u043e \u0443\u043b\u044e\u0431\u043b\u0435\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0442\u0430 \u0432\u0441\u0442\u0430\u0432\u0442\u0435 \u0432 \u043d\u044c\u043e\u0433\u043e \u0446\u0435:<\/p>\n<pre><code>\nchangedFiles=\"$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)\"\n\nrunOnChange() {\n    echo \"$changedFiles\" | grep -q \"$1\" &amp;&amp; echo -e \"$2\"\n}\n\nrunOnChange package-lock.json \"033[35m*******************************************************************************n* 033[33mpackage-lock.json033[35m has changed. Run033[33m npm install033[35m to update your dependencies. *n*******************************************************************************\"\n\nexit 0\n<\/code><\/pre>\n<p>\u041f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f \u0431\u0443\u0434\u0435 \u043d\u0430\u0434\u0440\u0443\u043a\u043e\u0432\u0430\u043d\u043e \u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u043c \u043a\u043e\u043b\u044c\u043e\u0440\u043e\u043c \u0437\u0456 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 <code>package-lock.json<\/code>\u0442\u0430 <code>npm install<\/code>\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u043c. \u0426\u0435\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u0439 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u044f\u0454, \u0447\u0438 <code>package-lock.json<\/code>\u0431\u0443\u043b\u043e \u043e\u043d\u043e\u0432\u043b\u0435\u043d\u043e, \u0456 \u044f\u043a\u0449\u043e \u0432\u0438 \u0445\u043e\u0447\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 <code>yarn.lock<\/code>\u0437\u0430\u043c\u0456\u0441\u0442\u044c \u0446\u044c\u043e\u0433\u043e, \u0432\u0430\u043c \u0434\u043e\u0432\u0435\u0434\u0435\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043c\u0456\u043d\u0438\u0442\u0438 \u043d\u0430\u0437\u0432\u0443 \u0444\u0430\u0439\u043b\u0443.<\/p>\n<h2>\u041f\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0443 \u0437\u043c\u0456\u043d\u0438 \u0444\u0430\u0439\u043b\u0443 \u0431\u043b\u043e\u043a\u0443\u0432\u0430\u043d\u043d\u044f<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 \u0446\u0435 \u043d\u0435 \u043d\u0430\u0434\u0442\u043e \u0441\u043a\u043b\u0430\u0434\u043d\u043e. \u041f\u043e \u0441\u0443\u0442\u0456, \u0432\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043d\u043e\u0432\u0443 \u0433\u0456\u043b\u043a\u0443, \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438 \u044f\u043a\u0438\u0439\u0441\u044c \u043f\u0430\u043a\u0435\u0442, \u0449\u043e\u0431 <code>package-lock.json<\/code>\u0437\u043c\u0456\u043d\u0438\u0442\u0438 \u0439\u043e\u0433\u043e, \u0437\u0430\u0444\u0456\u043a\u0441\u0443\u0432\u0430\u0442\u0438 \u0439\u043e\u0433\u043e \u0442\u0430 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0434\u043e \u043f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u044c\u043e\u0457 \u0433\u0456\u043b\u043a\u0438. \u0412\u0441\u0435, \u0449\u043e \u043c\u043e\u0436\u043d\u0430 \u0437\u0440\u043e\u0431\u0438\u0442\u0438 \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0446\u0456\u0454\u0457 \u043a\u043e\u043c\u0430\u043d\u0434\u0438:<\/p>\n<pre><code>git checkout -b testbranch &amp;&amp; npm i -D lint-staged &amp;&amp; git add. &amp;&amp; git commit -m \"test\" &amp;&amp; git checkout - <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u043e\u0431&#8217;\u0454\u0434\u043d\u0430\u0442\u0438 \u0439\u043e\u0433\u043e \u0437 \u0446\u0456\u0454\u044e \u0433\u0456\u043b\u043a\u043e\u044e<\/p>\n<pre><code>git merge testbranch<\/code><\/pre>\n<p>\u0426\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0445\u0443\u043a \u043f\u0456\u0441\u043b\u044f \u0437\u043b\u0438\u0442\u0442\u044f \u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0448 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u0439. \u0422\u043e\u0434\u0456 \u0432\u0438 \u043f\u043e\u0431\u0430\u0447\u0438\u0442\u0435 \u0446\u0435 \u043f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u043c\u0443 \u0440\u044f\u0434\u043a\u0443, \u043e\u0441\u043a\u0456\u043b\u044c\u043a\u0438 <code>package-lock.json<\/code>\u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u043b\u0438\u0442\u0442\u044f \u0431\u0443\u043b\u043e \u0437\u043c\u0456\u043d\u0435\u043d\u043e:<\/p>\n<h2>\u0412\u0438\u044f\u0432\u043b\u0435\u043d\u043d\u044f \u0437\u043c\u0456\u043d\u0438 \u0444\u0430\u0439\u043b\u0443 \u0431\u043b\u043e\u043a\u0443\u0432\u0430\u043d\u043d\u044f \u0443 VS Code<\/h2>\n<p>\u0426\u0435 \u0431\u0443\u043b\u043e \u043b\u0438\u0448\u0435 \u043e\u0434\u043d\u0435 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f. \u0425\u0443\u043a\u0438 Git \u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0431\u0430\u0433\u0430\u0442\u044c\u043c\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0449\u043e\u0431 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 Prettier \u043f\u0435\u0440\u0435\u0434 \u0442\u0438\u043c, \u044f\u043a \u0449\u043e\u0441\u044c \u0437\u0430\u0444\u0456\u043a\u0441\u0443\u0432\u0430\u0442\u0438 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u043a\u043e\u0434\u0443.<\/p>\n<p>\u0414\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0432\u0438\u043f\u0430\u0434\u043a\u0443 \u0454 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0438 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438, \u0447\u0438 <code>package-lock.json<\/code>\u0431\u0443\u043b\u043e \u043e\u043d\u043e\u0432\u043b\u0435\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0434\u043b\u044f VS Code \u0454 \u0447\u0443\u0434\u043e\u0432\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=matteopieroni.refresh-npm-packages\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">Refresh NPM Packages<\/a>, \u044f\u043a\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u043f\u043e\u043d\u0443\u0454 \u0432\u0430\u043c \u043e\u043d\u043e\u0432\u0438\u0442\u0438 \u043f\u0430\u043a\u0435\u0442\u0438, \u044f\u043a\u0449\u043e \u0432\u0438\u044f\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u044e. \u0412\u0456\u043d \u043f\u0440\u0430\u0446\u044e\u0432\u0430\u0442\u0438\u043c\u0435 \u043d\u0435\u0437\u0430\u043b\u0435\u0436\u043d\u043e \u0432\u0456\u0434 \u0442\u043e\u0433\u043e, \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043b\u0438 \u0432\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u043f\u043b\u0435\u043d\u043d\u044f Git \u0447\u0438 \u043d\u0456. \u0429\u0435 \u043e\u0434\u043d\u0430 \u043f\u0440\u0438\u0454\u043c\u043d\u0430 \u0440\u0456\u0447 \u2013 \u0446\u0435 \u043f\u0440\u0430\u0446\u044e\u0432\u0430\u0442\u0438\u043c\u0435, \u043a\u043e\u043b\u0438 \u0432\u0438 \u0437\u043c\u0456\u043d\u044e\u0454\u0442\u0435 \u0433\u0456\u043b\u043a\u0438, \u043d\u0430\u0432\u0456\u0442\u044c \u0431\u0435\u0437 \u0437\u043b\u0438\u0442\u0442\u044f \u043e\u0434\u043d\u0456\u0454\u0457 \u0437 \u043d\u0438\u0445 \u0432 \u0456\u043d\u0448\u0443.<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-157772-61e6c09a98d0e.png\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-157772-61e6c09a98d0e.png\" alt=\"\u042f\u043a \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u043f\u043b\u044e\u0432\u0430\u0447\u0456 Git \u0434\u043b\u044f \u0432\u0438\u044f\u0432\u043b\u0435\u043d\u043d\u044f \u0437\u043c\u0456\u043d \u0443 \u0444\u0430\u0439\u043b\u0456 \u0431\u043b\u043e\u043a\u0443\u0432\u0430\u043d\u043d\u044f \u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u0443 \u043f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f\" ><\/a><\/p>\n<p>\u041e\u0434\u043d\u0430\u043a \u043f\u0435\u0440\u0435\u0432\u0430\u0433\u0430 \u0442\u043e\u0433\u043e, \u0449\u043e \u043c\u0438 \u0442\u0443\u0442 \u0440\u0435\u0430\u043b\u0456\u0437\u0443\u0432\u0430\u043b\u0438, \u043f\u043e\u043b\u044f\u0433\u0430\u0454 \u0432 \u0442\u043e\u043c\u0443, \u0449\u043e \u0432\u043e\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u0438\u043c\u0435\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u043c\u0443 \u0440\u044f\u0434\u043a\u0443 \u0456 \u043d\u0435 \u0437\u0430\u043b\u0435\u0436\u0438\u0442\u044c \u0432\u0456\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043a\u043e\u0434\u0443. \u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u044f\u043a\u0449\u043e \u0432\u0438 \u043f\u0440\u0430\u0446\u044e\u0454\u0442\u0435 \u043d\u0430\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0437 \u0432\u0456\u0434\u043a\u0440\u0438\u0442\u0438\u043c \u0432\u0438\u0445\u0456\u0434\u043d\u0438\u043c \u043a\u043e\u0434\u043e\u043c, \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u0442\u0438 \u0442\u0435, \u0449\u043e \u0442\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e, \u0449\u043e\u0431 \u043c\u0430\u0442\u0438 \u0441\u043f\u0456\u043b\u044c\u043d\u0443 \u043e\u0441\u043d\u043e\u0432\u0443 \u0434\u043b\u044f \u0432\u0441\u0456\u0445 \u0437\u0430\u043b\u0443\u0447\u0435\u043d\u0438\u0445 \u0440\u043e\u0437\u0440\u043e\u0431\u043d\u0438\u043a\u0456\u0432, \u043d\u0435\u0437\u0430\u043b\u0435\u0436\u043d\u043e \u0432\u0456\u0434 \u0457\u0445\u043d\u0456\u0445 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u044c.<\/p>\n<p><div id=\"PostUnique_PostSource\" style=\"padding-top: 50px\">\u0414\u0436\u0435\u0440\u0435\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0443:  <a target=\"_blank\" rel=\"noopener nofollow\" href=\"\/\/startfunction.com\" class=\"external external_icon\">startfunction.com<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u0456\u0437\u043d\u0430\u0439\u0442\u0435\u0441\u044f, \u044f\u043a \u0432\u0438\u044f\u0432\u043b\u044f\u0442\u0438 \u0437\u043c\u0456\u043d\u0438 \u0443 \u0444\u0430\u0439\u043b\u0456 package-lock.json \u0430\u0431\u043e yarn.lock \u0456 \u043f\u043e\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u043f\u0435\u0440\u0435\u0445\u043e\u043f\u043b\u044e\u0432\u0430\u0447\u0456\u0432 Git \u0456 Husky<\/p>\n","protected":false},"author":1,"featured_media":157773,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[756,839,902,777,849,788,725],"tags":[1174],"class_list":["post-231984","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vidkryte-dzherelo","category-kerivnytstvo-dlia-pochatkivtsiv","category-kod-3","category-kontrol-dzherela","category-pidruchnyky","category-prohramne-zabezpechennia-z-vidkrytym-kodom","category-rozrobnyk","tag-affiai-uk"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/231984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/comments?post=231984"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/231984\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media\/157773"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media?parent=231984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/categories?post=231984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/tags?post=231984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}