IT박스

IntelliJ를 사용하여 git 커밋 메시지 수정

itboxs 2020. 8. 23. 08:42
반응형

IntelliJ를 사용하여 git 커밋 메시지 수정


을 사용하여 git 커밋 메시지를 수정할 수 있습니까 IntelliJ? 아니면 명령 줄을 사용해야합니까?

제발 어떻게 할 수 있습니까?


보기 => 도구 창 => 버전 관리. ( Windows (Alt + 9) / OS X (Cmd + 9) )

IntelliJ 2017.1 이상 => 로그로 이동하여 마우스 오른쪽 버튼으로 클릭 + 단어 변경 또는 F2를 누릅니다.

IntelliJ 이름 바꾸기 커밋

동일한 지점에있는 동안 (체크 아웃 한 지점은 동일합니다)


Amend가 지원됩니다. "Commit Changes"를 호출하고 Commit 대화 상자에서 "Amend commit"확인란을 선택합니다. 그런 다음 "커밋"버튼을 누르면 커밋이 이전 커밋으로 수정됩니다.

그러나 지원은 제한적입니다.

  • 수정중인 커밋의 세부 정보를 볼 수 없습니다.
  • 커밋되지 않은 변경 사항이없는 경우 (예 : 더 많은 변경 사항을 추가하지 않고 이전 커밋의 메시지를 변경하려는 경우) "커밋"을 호출 할 수 없습니다.

마침내이 문제에 대한 해결 방법을 찾았습니다.이 문제는 며칠 동안 나를 괴롭 혔습니다.

  1. 버전 관리-로그 탭으로 이동
  2. 변경 사항 아래에서 버전을 선택하십시오. 마우스 오른쪽 버튼을 클릭하고 "현재 분기를 여기로 재설정"이라고 말합니다.
  3. "소프트"를 선택하고 재설정을 클릭합니다. 이것은 매우 중요합니다. 변경 사항이 손실되지 않도록 소프트를 클릭해야합니다.
  4. 버전 관리, 로컬 변경 사항을 확인하십시오. 변경 사항은 동일한 변경 목록에서 사용할 수 있습니다.
  5. 변경 목록을 마우스 오른쪽 버튼으로 클릭하고 커밋을 선택합니다.
  6. 이전 커밋 메시지가 표시됩니다. 이제 주석을 수정하고 커밋 및 푸시라고 말할 수 있습니다.

    Note: This solution uses android studio as intellij platform. 
    

You can also go to your git folder with a terminal and shell like powershell, cmd or bash (depends on your system), and then type:

git commit --amend -m "your new commit message"

Commit messages can be edited during a rebase. Invoke the Rebase command from the VCS menu, confirm the branch settings, then click the Rebase button. You'll be presented with a list of your unpushed commits. Choose the reword action from the drop-down to the left of the message you want to edit.

Check the git doc on Rewriting History for details on other rebase actions.


In the Log tab, select the commit and press F2 (Reword). Thats it.


To be fair, the quickest way to do this is via the command line. I know the OP was asking about doing it via IntelliJ (Its how I found this question, I was trying to do it in PHPStorm), but seriously, its so much easier via the command line.

When in the correct folder in your terminal / command prompt type

git commit --amend

You'll then be shown the last commit message, simply edit the text and save the file, job done!

If you want to change the editor (it defaults to vi), then use this command, changing "vim" to your editor of choice.

git config --global core.editor "vim"

i.e. windows users may want to...

git config --global core.editor "notepad"

Source: https://help.github.com/articles/changing-a-commit-message/


In case, 2018.3 and same with 2017.1

Alt + 9 (version control window)

And right click -> context menu click "Reword... F2 "

OR

바로 가기 F2메시지를 편집 할 수 있습니다.


JetBrains에서 Go to View -> Version Control-> 그러면 화면 하단에 버전 관리 로그 탭이 열리고 Go to Log마지막으로 한 커밋을 볼 수 있습니다. 마우스 오른쪽 버튼을 클릭하고undo commit

빙고! 모든 커밋을 되 돌렸고 메시지가 지워졌습니다. 커밋 메시지 만 변경하려는 경우 소프트 리셋을 선택할 수도 있습니다.

참고 URL : https://stackoverflow.com/questions/14075919/using-intellij-to-amend-git-commit-message

반응형