4.10.5 diff 내용을 추가하여 커밋

    커밋 메시지를 작성할 때 -v 옵션을 같이 사용하면 vi 에디터에서 diff 내용을 추가할 수 있습니다.

    infoh@hojin MINGW64 /e/gitstudy04 (master)

    $ git commit -v diff 내용 추가

    다음과 같이 커밋 메시지를 작성하면 diff 내용이 추가됩니다.

    ▼ 그림 4-28 커밋 메시지를 작성할 때 diff 내용 추가

    0427.jpg

    # Please enter the commit message for your changes. Lines starting

    # with '#' will be ignored, and an empty message aborts the commit.

    #

    # On branch master

    # Changes to be committed:

    # modified: index.htm

    #

    # ------------------------------------------------------------

    # Do not modify or remove the line above.

    # Everything below it will be ignored.

    diff --git a/index.htm b/index.htm

    index 56af0de..a82537d 100644

    --- a/index.htm

    +++ b/index.htm

    @@ -8,5 +8,6 @@

    <body>

    <h1>hello GIT world!</h1>

    <h2>깃을 이용하면 소스의 버전 관리를 쉽게 있습니다.</h2>

    <p>커밋 -v 옵션을 통하여 diff 내용을 추가할 있습니다.</p>

    </body>

    </html>

    E:/gitstudy/.git/COMMIT_EDITMSG [unix] (02:40 14/01/2019) 1,0-1 꼭대기

    "E:/gitstudy/.git/COMMIT_EDITMSG" [유닉스] 23L, 718C

    신간 소식 구독하기
    뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.