ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Window OS에서 Git Secret 사용하기 2
    개발 2020. 6. 9. 19:15

     

    파일 암호화 하기


    기존 Local Repository 입니다.

     

     

    1. Ubuntu에서 git-secret을 적용할 디렉토리로 이동 후 다음 명령어 작성합니다.

    $ cd /mnt/c/Yujin/gitSecret
    $ git-secret init

     

    다음과 같은 결과가 나오면 성공입니다.

    git-secret: init created: '/mnt/c/Yujin/gitSecret/.gitsecret/'

     

     

    2. 사용자를 추가합니다.

    $ git-secret tell 'email@gmail.com'

     

    다음과 같이 키박스 파일이 생성되면 성공입니다.

    gpg: keybox '/mnt/c/Yujin/gitSecret/.gitsecret/keys/pubring.kbx' created
    gpg: /mnt/c/Yujin/gitSecret/.gitsecret/keys/trustdb.gpg: trustdb created

     

     

     

    3. git-secret을 적용시킬 파일을 추가합니다.

    $ git-secret add 'filename'

     

    저는 다음과 같은 "test.txt" 파일을 생성하여 암호화 시킬 예정입니다.

     

    $ git-secret add test.txt

     

    기존 test.txt파일은 당연히 git에 올라가지 않습니다. (암호화된 파일만 업로드 가능합니다.)

    자동으로 .gitignore 파일에 추가해주어 test.txt파일을 숨겨놓습니다.

    git-secret: these files are not in .gitignore: test.txt
    git-secret: auto adding them to .gitignore
    git-secret: 1 item(s) added.

     

     

    4. 실제 add해둔 파일을 암호화 시킵니다.

    $ git-secret hide

     

    파일이 정상적으로 암호화 되었다면 다음과 같은 결과를 확인할 수 있습니다.

    git-secret: done. 1 of 1 files are hidden.

     

     

     

    * git-secret을 적용시킨 후 생성된 파일들을 commit, push 하시면 됩니다. *

     

     

    다음 글에서는 이 git-secret을 적용시킨(암호화) 파일을 복호화 하는 방법에 대해 설명드리겠습니다.

     

     

    '개발' 카테고리의 다른 글

    Window OS에서 Git Secret 사용하기 3  (0) 2020.06.09
    Windows 10에서 Ubuntu 사용하기  (0) 2020.05.25

    댓글

Designed by Tistory.