{"id":287456,"date":"2018-08-16T14:09:34","date_gmt":"2018-08-16T10:09:34","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=287456"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2018-08-16T10:09:34","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=287456","title":{"rendered":"Git happens! 6 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a Git \u0438 \u043a\u0430\u043a \u0438\u0445 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/company\/flant\/blog\/419733\/\" class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/n_\/nq\/m6\/n_nqm6jyinrnpra6in4_sfpjhgy.png\"><\/p>\n<p>  <i><b>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>: \u041d\u0430 \u0434\u043d\u044f\u0445 \u0432 \u0431\u043b\u043e\u0433\u0435 \u0434\u043b\u044f \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e \u043d\u0430\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 GitLab \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043d\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438 \u043d\u0435\u0440\u0432\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441\u043b\u0443\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Git. \u0412\u0440\u044f\u0434 \u043b\u0438 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u043e\u0432\u044b \u0434\u043b\u044f \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0439\u0434\u0443\u0442\u0441\u044f \u0438 \u0442\u0435, \u043a\u043e\u043c\u0443 \u043e\u043d\u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f. \u0410 \u0432 \u043a\u043e\u043d\u0435\u0446 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u043e\u043d\u0443\u0441 \u043e\u0442 \u0441\u0435\u0431\u044f. \u0425\u043e\u0440\u043e\u0448\u0435\u0439 \u0432\u0441\u0435\u043c \u043f\u044f\u0442\u043d\u0438\u0446\u044b!<\/i><\/p>\n<p>  \u0412\u0441\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u043a\u0430\u043a Git. \u041d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u0435: Git happens!<a name=\"habracut\"><\/a><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u043f\u0443\u0442\u044c \u0441 Git, \u043e\u0431\u0443\u0447\u0438\u0442\u0435\u0441\u044c <a href=\"https:\/\/docs.gitlab.com\/ee\/gitlab-basics\/start-using-git.html\">\u043e\u0441\u043d\u043e\u0432\u0430\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c<\/a> \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435. \u0410 \u0437\u0434\u0435\u0441\u044c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0448\u0435\u0441\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 Git.<\/p>\n<h2>1. \u0423\u043f\u0441\u2026 \u042f \u043e\u0448\u0438\u0431\u0441\u044f \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c\u0443 \u043a\u043e\u043c\u043c\u0438\u0442\u0443<\/h2>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0447\u0430\u0441\u043e\u0432 \u043a\u043e\u0434\u0438\u043d\u0433\u0430 \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u0430. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c:<\/p>\n<pre><code class=\"bash\">git commit --amend<\/code><\/pre>\n<p>  \u0421 \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c\u0443 \u043a\u043e\u043c\u043c\u0438\u0442\u0443. \u0418 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0443\u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u00abaddded\u00bb \u0441 \u0442\u0440\u0435\u043c\u044f \u00abd\u00bb.<\/p>\n<h2>2. \u0423\u043f\u0441\u2026 \u042f \u0437\u0430\u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c\u0443 \u043a\u043e\u043c\u043c\u0438\u0442\u0443<\/h2>\n<p>  \u0414\u0440\u0443\u0433\u0430\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 Git \u2014 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u043e\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442. \u0412\u044b \u0437\u0430\u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b, \u0437\u0430\u0431\u044b\u043b\u0438 \u0435\u0433\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043d\u0435\u0441\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043c\u0438\u0442 \u0441\u0442\u0430\u043b \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u043c? \u0412\u0430\u0448\u0438\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043d\u043e\u0432\u0430 \u0431\u0443\u0434\u0435\u0442 <code>--amend<\/code>.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u044d\u0442\u0443 \u0432\u0435\u0440\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">git add missed-file.txt git commit --amend<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0438\u0431\u043e \u043e\u0442\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u0440\u0435\u0436\u043d\u0435\u043c \u0432\u0438\u0434\u0435 (\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c).<\/p>\n<h2>3. \u0423\u043f\u0441\u2026 \u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/h2>\n<p>  \u041d\u043e \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f? \u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u0438\u0442\u044c? \u041e\u0431\u043c\u0430\u043d\u0447\u0438\u0432\u044b\u0439 ENV-\u0444\u0430\u0439\u043b, \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u043b\u0438 \u0444\u043e\u0442\u043e \u0441 \u043a\u043e\u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043e \u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435\u2026 \u0412\u0441\u0451 \u0440\u0435\u0448\u0430\u0435\u043c\u043e.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e <i>stage<\/i> \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u0430 \u0438 \u0435\u0449\u0451 \u043d\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u043d\u0443\u043b\u0438 \u0435\u0433\u043e, \u0432\u0441\u0451 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <i>reset<\/i> \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u0432 stage):<\/p>\n<pre><code class=\"bash\">git reset \/assets\/img\/misty-and-pepper.jpg<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u044b \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u043d\u0443\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0433:<\/p>\n<pre><code class=\"bash\">git reset --soft HEAD~1 git reset \/assets\/img\/misty-and-pepper.jpg rm \/assets\/img\/misty-and-pepper.jpg git commit<\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043c\u0438\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0430\u0447\u0435\u043d, \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442.<\/p>\n<p>  <i><b>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>: \u041a\u0430\u043a \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043e \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043a \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0433\u043e <code>--amend<\/code>. \u041f\u043e \u0432\u0441\u0435\u0439 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0443\u043d\u043a\u0442\u043e\u043c \u0430\u0432\u0442\u043e\u0440 \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0435\u0449\u0451 \u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432 \u0434\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438.<\/i><\/p>\n<h2>4. \u0423\u043f\u0441\u2026 \u042f \u043a\u043e\u043c\u043c\u0438\u0442\u043d\u0443\u043b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 master<\/h2>\n<p>  \u0418\u0442\u0430\u043a, \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u043d\u0430\u0434 \u043d\u043e\u0432\u043e\u0439 \u0444\u0438\u0447\u0435\u0439 \u0438 \u043f\u043e\u0441\u043f\u0435\u0448\u0438\u043b\u0438, \u0437\u0430\u0431\u044b\u0432 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u0434\u043b\u044f \u043d\u0435\u0451. \u0412\u044b \u0443\u0436\u0435 \u043a\u043e\u043c\u043c\u0438\u0442\u043d\u0443\u043b\u0438 \u043a\u0443\u0447\u0443 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0432\u0441\u0435 \u044d\u0442\u0438 \u043a\u043e\u043c\u043c\u0438\u0442\u044b \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0432 master&#8217;\u0435. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, GitLab <a href=\"https:\/\/about.gitlab.com\/2014\/11\/26\/keeping-your-code-protected\">\u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0442\u044c<\/a> push&#8217;\u044b \u043f\u0440\u044f\u043c\u043e \u0432 master. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0442\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438:<\/p>\n<p>  <i><b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/b>: \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u043c\u043c\u0438\u0442\u043d\u0443\u043b\u0438 \u0438\u043b\u0438 <i>stash<\/i>&#8216;\u043d\u0443\u043b\u0438 \u0441\u0432\u043e\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u2014 \u0438\u043d\u0430\u0447\u0435 \u0432\u0441\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0443\u0442\u0435\u0440\u044f\u043d\u044b!<\/i><\/p>\n<pre><code class=\"bash\">git branch future-brunch git reset HEAD~ --hard git checkout future-brunch<\/code><\/pre>\n<p>  \u0411\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0442\u043a\u0430, \u0432 master&#8217;\u0435 \u2014 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0451\u043d \u043e\u0442\u043a\u0430\u0442 \u0434\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d \u0431\u044b\u043b \u0434\u043e \u0432\u0430\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u043d <i>checkout<\/i> \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0442\u043a\u0438 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0432\u0430\u0448\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<h2>5. \u0423\u043f\u0441\u2026 \u042f \u0441\u0434\u0435\u043b\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0432\u0435\u0442\u043a\u0438<\/h2>\n<p>  \u0421\u0430\u043c\u044b\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0432\u0435\u0442\u043a\u0438. \u0423\u0436\u0435 \u043f\u043e\u0447\u0442\u0438 15:00, \u0430 \u044f \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0435 \u043e\u0431\u0435\u0434\u0430\u043b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0439 \u0433\u043e\u043b\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043b \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0442\u043a\u0443 (<i>br<b>a<\/b>nch<\/i>) \u043a\u0430\u043a <i>future-br<b>u<\/b>nch<\/i>. \u0412\u043a\u0443\u0441\u043d\u043e\u0442\u0438\u0449\u0430!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/m0\/lw\/uh\/m0lwuheyhfeewx0culyotitcaqg.png\"><\/p>\n<p>  \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c \u044d\u0442\u0443 \u0432\u0435\u0442\u043a\u0443 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <i>mv<\/i>, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0432 \u0435\u0451 \u0432 \u043d\u043e\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"bash\">git branch -m future-brunch feature-branch<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 push&#8217;\u043d\u0443\u043b\u0438 \u044d\u0442\u0443 \u0432\u0435\u0442\u043a\u0443, \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0430\u0440\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432. \u041c\u044b \u0443\u0434\u0430\u043b\u0438\u043c \u0441\u0442\u0430\u0440\u0443\u044e \u0432\u0435\u0442\u043a\u0443 \u0438\u0437 <i>remote<\/i> \u0438 push&#8217;\u043d\u0435\u043c \u043d\u043e\u0432\u0443\u044e:<\/p>\n<pre><code class=\"bash\">git push origin --delete future-brunch git push origin feature-branch<\/code><\/pre>\n<p>  <i><b>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>: \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0435\u0442\u043a\u0443 \u0438\u0437 remote \u0435\u0449\u0451 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e:<\/i><\/p>\n<pre><code class=\"bash\">git push origin :future-brunch<\/code><\/pre>\n<p>  <\/p>\n<h2>6. Oops\u2026 I did it again!<\/h2>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0430 \u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0451 \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0430\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438 \u043d\u0430\u0432\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0438 \u043a\u0443\u0447\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441\u043e Stack Overflow, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0432\u0441\u0451 \u0441\u0442\u0430\u043b\u043e \u0435\u0449\u0451 \u0445\u0443\u0436\u0435, \u0447\u0435\u043c \u0431\u044b\u043b\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435. \u0412\u0441\u0435 \u043c\u044b \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u2026<\/p>\n<p>  <code>git reflog<\/code> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0445 \u0432\u0430\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0417\u0430\u0442\u0435\u043c \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Git&#8217;\u0430 \u043f\u043e \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u044e \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0442.\u0435. \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e. \u0414\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u0430\u0448\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043d\u0430\u0434\u0435\u0436\u0434\u0430 \u2014 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u0442\u044c \u043a \u043d\u0435\u0439 \u0432 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445. \u0418\u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435:<\/p>\n<pre><code class=\"bash\">git reflog<\/code><\/pre>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u043d\u0430\u0448 \u0448\u0430\u0433 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u0447\u0443\u0442\u043a\u0438\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435\u043c Git&#8217;\u0430. \u0417\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0432\u044b\u0448\u0435 \u0432\u044b\u0434\u0430\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\">3ff8691 (HEAD -&gt; feature-branch) HEAD@{0}: Branch: renamed refs\/heads\/future-brunch to refs\/heads\/feature-branch 3ff8691 (HEAD -&gt; feature-branch) HEAD@{2}: checkout: moving from master to future-brunch 2b7e508 (master) HEAD@{3}: reset: moving to HEAD~ 3ff8691 (HEAD -&gt; feature-branch) HEAD@{4}: commit: Adds the client logo 2b7e508 (master) HEAD@{5}: reset: moving to HEAD~1 37a632d HEAD@{6}: commit: Adds the client logo to the project 2b7e508 (master) HEAD@{7}: reset: moving to HEAD 2b7e508 (master) HEAD@{8}: commit (amend): Added contributing info to the site dfa27a2 HEAD@{9}: reset: moving to HEAD dfa27a2 HEAD@{10}: commit (amend): Added contributing info to the site 700d0b5 HEAD@{11}: commit: Addded contributing info to the site efba795 HEAD@{12}: commit (initial): Initial commit<\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0430\u043c\u044b\u0439 \u043b\u0435\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u2014 \u044d\u0442\u043e \u0438\u043d\u0434\u0435\u043a\u0441. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 <code>{index}<\/code> \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>dfa27a2<\/code>):<\/p>\n<pre><code class=\"bash\">git reset HEAD@{index}<\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0448\u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0432\u044b\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0447\u0430\u0441\u0442\u044b\u0445 Gitfalls <i>(\u0438\u0433\u0440\u0430 \u0441\u043b\u043e\u0432: pitfall \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u00ab\u043b\u043e\u0432\u0443\u0448\u043a\u0430, \u043e\u0448\u0438\u0431\u043a\u0430\u00bb \u2014 <b>\u043f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>)<\/i>.<\/p>\n<h2>\u0411\u043e\u043d\u0443\u0441 \u043e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430<\/h2>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0446\u0435\u043d\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043a\u043e \u0432\u0441\u0435\u043c\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c\u0443 \u0432\u044b\u0448\u0435 (\u043a\u0440\u043e\u043c\u0435 \u043f\u0443\u043d\u043a\u0442\u0430 5). \u041d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u043d\u044f\u044e\u0442 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0445 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c, \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u044b\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0432 <i>remote<\/i> (push&#8217;\u043d\u0443\u0442\u044b). \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u0430\u0440\u044b\u0439 \u043f\u043b\u043e\u0445\u043e\u0439 \u043a\u043e\u043c\u043c\u0438\u0442 \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 <i>remote<\/i>-\u0432\u0435\u0442\u043a\u0435 \u0438 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c <code>git pull<\/code> (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 <i>merge<\/i>, \u0438 \u0442\u043e\u0433\u0434\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u00ab\u043f\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c\u00bb \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0445\u0443\u0434\u0448\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c), \u043b\u0438\u0431\u043e <code>git push --force<\/code>, \u0447\u0442\u043e \u0447\u0440\u0435\u0432\u0430\u0442\u043e \u043f\u043e\u0442\u0435\u0440\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0432\u0435\u0442\u043a\u043e\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u2026<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/b5\/a3\/jo\/b5a3jomkgjnpqnzncgub0ok9xng.jpeg\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u2014 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043e\u043f\u044b\u0442\u0430:<\/p>\n<ul>\n<li> \u0415\u0441\u043b\u0438 \u0432\u044b (\u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0442) \u0441\u043c\u0435\u043d\u0438\u043b\u0438 \u0432\u0435\u0442\u043a\u0443 \u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e, \u0441\u0430\u043c\u044b\u0439 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>git checkout -<\/code>.<\/li>\n<li> \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043a \u043a\u043e\u043c\u043c\u0438\u0442\u0443 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u0443\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d, \u043d\u043e \u0435\u0449\u0451 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043a\u043e\u043c\u043c\u0438\u0442 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>git reset HEAD path\/to\/file<\/code>. \u041f\u043e\u0445\u043e\u0436\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0432 \u043f\u0443\u043d\u043a\u0442\u0435 3, \u043d\u043e \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u043d\u0430 \u0448\u0438\u0440\u0435, \u0442.\u043a. \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043b\u044e\u0431\u044b\u043c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 \u043a\u043e\u043c\u043c\u0438\u0442\u0435 (\u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0441\u043b\u0443\u0447\u0430\u044e \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430).<\/li>\n<li> \u0425\u043e\u0440\u043e\u0448\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u043a\u043e\u043c\u043c\u0438\u0442\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0435\u0433\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>-p<\/code> \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 \u043a \u043a\u043e\u043c\u043c\u0438\u0442\u0443 (<code>git add -p<\/code>). \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c review \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0439\u0434\u0451\u0442 \u0432 \u043a\u043e\u043c\u043c\u0438\u0442. \u041d\u043e \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a \u043a\u043e\u043c\u043c\u0438\u0442\u0443 untracked-\u0444\u0430\u0439\u043b\u044b \u2014 \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/li>\n<li> \u0420\u044f\u0434 \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0439 (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445), \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 2014 \u0433\u043e\u0434\u0430 \u00ab<a href=\"https:\/\/www.codementor.io\/citizen428\/git-tutorial-10-common-git-problems-and-how-to-fix-them-aajv0katd\">Git Tutorial: 10 Common Git Problems and How to Fix Them<\/a>\u00bb. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>git revert<\/code> \u0438 <code>git rebase -i<\/code>.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>P.S. \u043e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430<\/h2>\n<p>  \u0427\u0438\u0442\u0430\u0439\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435:<\/p>\n<ul>\n<li> \u00abGitLab CI \u0434\u043b\u044f \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 production\u00bb: <a href=\"https:\/\/habr.com\/company\/flant\/blog\/332712\/\">\u0427\u0430\u0441\u0442\u044c 1 (\u043d\u0430\u0448 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d)<\/a>; <a href=\"https:\/\/habr.com\/company\/flant\/blog\/332842\/\">\u0427\u0430\u0441\u0442\u044c 2 (\u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u0432\u0430\u044f \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438)<\/a>;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/company\/flant\/blog\/345116\/\">\u041b\u0443\u0447\u0448\u0438\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 CI\/CD \u0441 Kubernetes \u0438 GitLab (\u043e\u0431\u0437\u043e\u0440 \u0438 \u0432\u0438\u0434\u0435\u043e \u0434\u043e\u043a\u043b\u0430\u0434\u0430)<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/company\/flant\/blog\/340996\/\">\u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441 GitLab CI: \u043e\u0434\u0438\u043d .gitlab-ci.yml \u0434\u043b\u044f \u0441\u043e\u0442\u043d\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/a>\u00bb.<\/li>\n<\/ul>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/company\/flant\/blog\/419733\/\"> https:\/\/habr.com\/company\/flant\/blog\/419733\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/company\/flant\/blog\/419733\/\" class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/n_\/nq\/m6\/n_nqm6jyinrnpra6in4_sfpjhgy.png\"><\/p>\n<p>  <i><b>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/b>: \u041d\u0430 \u0434\u043d\u044f\u0445 \u0432 \u0431\u043b\u043e\u0433\u0435 \u0434\u043b\u044f \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u043b\u044e\u0431\u0438\u043c\u043e\u0433\u043e \u043d\u0430\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 GitLab \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043d\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438 \u043d\u0435\u0440\u0432\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441\u043b\u0443\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Git. \u0412\u0440\u044f\u0434 \u043b\u0438 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u043e\u0432\u044b \u0434\u043b\u044f \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0439\u0434\u0443\u0442\u0441\u044f \u0438 \u0442\u0435, \u043a\u043e\u043c\u0443 \u043e\u043d\u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f. \u0410 \u0432 \u043a\u043e\u043d\u0435\u0446 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u043e\u043d\u0443\u0441 \u043e\u0442 \u0441\u0435\u0431\u044f. \u0425\u043e\u0440\u043e\u0448\u0435\u0439 \u0432\u0441\u0435\u043c \u043f\u044f\u0442\u043d\u0438\u0446\u044b!<\/i><\/p>\n<p>  \u0412\u0441\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u043a\u0430\u043a Git. \u041d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u0435: Git happens!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-287456","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=287456"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287456\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}