반응형
Linux
(Ubuntu
)sudo apt install git-crypt sudo apt install gnupg
Windows
(scoop
으로 설치)scoop install git-crypt scoop install gnupg
-
bash
gpg --gen-key
-
name, e-mail, 암호 등을 설정해 주면 된다.
-
example repo :
https://github.com/account/repo
-
bash
git clone https://github.com/account/repo
-
bash
cd repo git-crypt init
-
.git/git-crypt/
경로가 생기고, 경로 밑에 관련 파일들이 자동 생성된다.
-
bash
vim .gitattributes
-
.gitattributes
# 암호화 될 파일들 설정 hello.txt filter=git-crypt diff=git-crypt code/world.cpp filter=git-crypt diff=git-crypt # 암호화 되지 않을 파일들 설정 # .gitattributes 파일은 암호화 되지 않도록 설정 .gitattributes !filter !diff README.md !filter !diff
-
bash
git add .gitattributes
-
bash
git commit * -m "testing" git push
-
다음부터
commit
및push
수행 시, 파일이 암호화되어github
에 저장된다.- 로컬 에 받은 파일은 암호화되지 않고 ,
github
에 올리는 파일만 암호화 됨.
- 로컬 에 받은 파일은 암호화되지 않고 ,
-
파일 수정
vim hello.txt
-
저장소 올리기
git commit * -m "testing" git push
-
(1)
git
저장소를clone
한다.git clone https://저장소.git
-
(2) 기존 저장소의
.git/git-crypt/*
를 현재 경로의.git/
경로 아래로 복사한다. -
(3) 다음과 같은 방식으로 키 값을 설정한다.
git-crypt init .git/git-crypt/
- 도움이 되셨으면 하단의 ❤️ 공감 버튼 부탁 드립니다. 감사합니다! 😄
- 일부 모바일 환경에서는 ❤️ 버튼이 보이지 않습니다.
728x90
반응형
'git svn' 카테고리의 다른 글
GitHub, 코딩 표준 AUTOSAR C++ 및 CERT C++에 대한 지원을 추가하여 기능 안전 애플리케이션 개발 가능 (0) | 2022.07.09 |
---|---|
git 브랜치 되돌리기 (revert branch) (0) | 2021.05.16 |
git branch (브랜치) 를 master (마스터) 로 (강제) 이동 (0) | 2019.07.31 |
Git 브랜치 목록 확인 방법: 간단한 명령어 가이드 (0) | 2019.02.05 |
원격 저장소에서 Pull Request 가져오기 (0) | 2018.10.31 |