forked from AGWA/git-crypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
USAGE
103 lines (71 loc) · 3.25 KB
/
USAGE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
================================================================================
=== INTRODUCTION ===
================================================================================
This file explains how to use git-crypt through a short scenario.
This scenario applies to Windows but has very few difference from a Linux usage.
For *NIX OS, just change "\" by "/".
================================================================================
=== APPLYING ENCRYPTION TO A NON-ENCRYPTED REPOSITORY ===
================================================================================
--- CREATING A WORKING COPY FOR A GIT REPO ---
cd /d "c:\the path\to your\target folder"
git init
git remote add origin https://user:[email protected]/path/to/repo.git
--- GENERATING KEYFILE FOR THE REPOSITORY ---
git-crypt init
NOTE: The key file will be stored in .\.git\git-crypt\key
--- DEFINING WHICH FILES TO ENCRYPT ---
Create a .gitattributes file at the root directory in the repository.
Add this content (this will encrypt C and C++ sources)
*.cpp filter=git-crypt diff=git-crypt
*.cxx filter=git-crypt diff=git-crypt
*.hpp filter=git-crypt diff=git-crypt
*.c filter=git-crypt diff=git-crypt
*.h filter=git-crypt diff=git-crypt
WARNING: never encrypt .gitattributes file or you'll encounter troubles
so, never create a line for ALL files (*)
--- COMMITTING GIT ATTRIBUTES ---
git add .gitattributes
git commit -a -m "Initial crypto file filter"
--- USING YOUR REPO ---
git add ...
git rm ...
git commit -a -m "xxx"
git push
git diff ...
git fetch ...
git pull ...
git merge ...
================================================================================
=== OPEN YOUR REPOSITORY TO OTHER PEOPLE ===
================================================================================
--- EXPORTING THE KEY ---
git-crypt export-key "c:\path to\keyfile"
NOTE: you may now give this file to people who should access your secured data.
================================================================================
=== CLONING AND USING AN ENCRYPTED REPOSITORY ===
================================================================================
--- GETTING THE KEYFILE ---
Get it or you won't be able to use the repo.
The project owner may have to export this key ; but you now know how to do.
--- MIGRATING THE KEY (IN CASE OF KEY CREATED BEFORE VERSION 0.4)
git-crypt migrate-key "c:\path to\keyfile"
--- CLONING THE REPO ---
cd /d "c:\the path\to your\parent folder"
git clone https://user:[email protected]/path/to/repo.git your_local_working_copy_dir_name
NOTE: cloning will make git retrieve the .gitattributes file, which should NOT be encrypted.
--- DECRYPTING THE WORKING COPY ---
git-crypt unlock "c:\path to\keyfile"
--- USING YOUR REPO ---
git add ...
git rm ...
git commit -a -m "xxx"
git push
git diff ...
git fetch ...
git pull ...
git merge ...
================================================================================
=== FINALLY ===
================================================================================
And now ... enjoy this cool tool!