{"componentChunkName":"component---src-templates-blog-post-js","path":"/git/git_command_line/","result":{"data":{"site":{"siteMetadata":{"title":"Progress Not Perfection","author":"Sunmin","siteUrl":"https://sunmin.netlify.com","comment":{"disqusShortName":"","utterances":"Sunmin0520/blog"}}},"markdownRemark":{"id":"7efdb519-6940-572c-b6e7-0a8b7492b4b8","excerpt":"아직 push 하지 않은 커밋을 취소하고 싶을 때  에러 상황: a라는 커밋메세지 적었으나 push과정에서 에러가 난 상황  이 command line을 적지 않으면 이후에 b라는 커밋메세지를 남겼을 때 push가 되었을 때 a,b 다 올라감 → 그것을 의도하지 않는다면 정리 필요 ‘error:failed to push some refs to remote주소’가 나올 때 해결  직전의 커밋 메세지를 수정   수정할 메세지 입력 →  수정사항 반영 협업시의 리모트에서는 force…","html":"<h2 id=\"아직-push-하지-않은-커밋을-취소하고-싶을-때\" style=\"position:relative;\"><a href=\"#%EC%95%84%EC%A7%81-push-%ED%95%98%EC%A7%80-%EC%95%8A%EC%9D%80-%EC%BB%A4%EB%B0%8B%EC%9D%84-%EC%B7%A8%EC%86%8C%ED%95%98%EA%B3%A0-%EC%8B%B6%EC%9D%84-%EB%95%8C\" aria-label=\"아직 push 하지 않은 커밋을 취소하고 싶을 때 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>아직 push 하지 않은 커밋을 취소하고 싶을 때</h2>\n<p><code class=\"language-text\">git reset HEAD^</code></p>\n<ul>\n<li>에러 상황: a라는 커밋메세지 적었으나 push과정에서 에러가 난 상황 </li>\n<li>이 command line을 적지 않으면 이후에 b라는 커밋메세지를 남겼을 때 push가 되었을 때 a,b 다 올라감 → 그것을 의도하지 않는다면 정리 필요</li>\n</ul>\n<h2 id=\"errorfailed-to-push-some-refs-to-remote주소가-나올-때\" style=\"position:relative;\"><a href=\"#errorfailed-to-push-some-refs-to-remote%EC%A3%BC%EC%86%8C%EA%B0%80-%EB%82%98%EC%98%AC-%EB%95%8C\" aria-label=\"errorfailed to push some refs to remote주소가 나올 때 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>‘error:failed to push some refs to remote주소’가 나올 때</h2>\n<div align=\"center\">\n  <img width=\"500px\" src=\"https://user-images.githubusercontent.com/60782131/106369849-2319bc00-6398-11eb-8fa4-3a5c850853f3.png\">\n  <br>\n</div>\n<ul>\n<li>해결 <code class=\"language-text\">git pull origin master --allow-unrelated-histories</code></li>\n</ul>\n<h2 id=\"직전의-커밋-메세지를-수정\" style=\"position:relative;\"><a href=\"#%EC%A7%81%EC%A0%84%EC%9D%98-%EC%BB%A4%EB%B0%8B-%EB%A9%94%EC%84%B8%EC%A7%80%EB%A5%BC-%EC%88%98%EC%A0%95\" aria-label=\"직전의 커밋 메세지를 수정 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>직전의 커밋 메세지를 수정</h2>\n<p><code class=\"language-text\">git commit --amend -m &quot;Add user crud&quot;</code>  수정할 메세지 입력 → <code class=\"language-text\">git push --force</code> 수정사항 반영</p>\n<ul>\n<li>협업시의 리모트에서는 force를 쓰는 것을 주의!</li>\n</ul>\n<h2 id=\"새-브랜치-생성-및-이동\" style=\"position:relative;\"><a href=\"#%EC%83%88-%EB%B8%8C%EB%9E%9C%EC%B9%98-%EC%83%9D%EC%84%B1-%EB%B0%8F-%EC%9D%B4%EB%8F%99\" aria-label=\"새 브랜치 생성 및 이동 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>새 브랜치 생성 및 이동</h2>\n<p><code class=\"language-text\">git checkout -b feature/userCRUD</code> 생성할 브랜치 이름 입력 &#x26; 이동</p>","frontmatter":{"title":"[git] 자주 쓰는 command line","date":"January 31, 2021"}}},"pageContext":{"slug":"/git/git_command_line/","previous":{"fields":{"slug":"/Retrospective/2021/30Jan/"},"frontmatter":{"title":"[TIL] 1월 30일 토요일","category":"retrospective","draft":false}},"next":{"fields":{"slug":"/Retrospective/2021/Jan/"},"frontmatter":{"title":"[회고] 1월 회고","category":"retrospective","draft":false}}}},"staticQueryHashes":["3128451518","521680639"]}