Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes and no.</p> <p>You could try to depend on hook but that supposes they are installed at the remote locations, and that is not always reliable.</p> <p>Another way to achieve almost the same effect would be by using a <strong><a href="https://stackoverflow.com/questions/2154948/how-can-i-track-system-specific-config-files-in-a-repo-project/2155355#2155355">smudge/clean attribute filter driver</a></strong>, <strong>but not for a full repo</strong>.</p> <p><img src="https://i.stack.imgur.com/4RzLi.png" alt="smudge/clean"></p> <p><sup>(Source: <a href="http://git-scm.com/book/en/v2/" rel="nofollow noreferrer">Pro Git book</a>: <a href="http://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes" rel="nofollow noreferrer">Customizing Git - Git Attributes</a>)</sup></p> <p>That way the smudge script is able decode the files, while the clean script would encode them.<br> Again, that could work for a few sensitive files, <strong>not for a full repo</strong>.</p> <p>Off course, those scripts would not be in the repository itself, and would be managed/communicated by another way. </p> <p>As <a href="https://stackoverflow.com/users/1556338/alkaline">Alkaline</a> points out <a href="https://stackoverflow.com/questions/2456954/git-encrypt-decrypt-remote-repository-files-while-push-pull/2457006#comment54706421_2457006">in the comments</a>, that idea does not scale for a repo, as the main git maintainer <a href="http://article.gmane.org/gmane.comp.version-control.git/113221" rel="nofollow noreferrer">Junio C. Hamano comments back in 2009</a>:</p> <blockquote> <p>As the sole raison d'etre of <code>diff.textconv</code> is to allow potentially lossy conversion (e.g. msword-to-text) applied to the preimage and postimage pair of contents (that are supposed to be "clean") before giving a textual diff to human consumption. </p> <p>The above config may appear to work, but <strong>if you really want an encrypted repository, you should be using an encrypting filesystem.<br> That would give an added benefit that the work tree associated with your repository would also be encrypted</strong>.</p> </blockquote> <hr> <p>Even though it does not scale to a full repo, the idea was implemented (3 years later in 2013) with <strong><a href="https://github.com/AGWA/git-crypt" rel="nofollow noreferrer"><code>git-crypt</code></a></strong>, as detailed in <a href="https://stackoverflow.com/users/1048170/dominic-cerisano">Dominic Cerisano</a>'s <a href="https://stackoverflow.com/a/45047100/6309">answer</a>.<br> <code>git-crypt</code> uses a <strong>content filter driver</strong> (implemented in cpp, with <a href="https://github.com/AGWA/git-crypt/blob/788a6a99f4289745e6bd12fae2ad8014af320a4f/commands.cpp#L149-L168" rel="nofollow noreferrer"><code>commands.cpp</code></a> setting up your <code>.gitattributes</code> with the relevant <code>smudge</code> and <code>clean</code> filter commands).<br> As any content filter driver, you can then limit the application of <code>git-crypt</code> to the set of files you want, in the same <code>.gitattributes</code> file:</p> <pre><code>secretfile filter=git-crypt diff=git-crypt *.key filter=git-crypt diff=git-crypt </code></pre> <p>As <a href="https://github.com/AGWA/git-crypt/blob/788a6a99f4289745e6bd12fae2ad8014af320a4f/README#L93-L102" rel="nofollow noreferrer">mentioned in the <code>README</code></a>:</p> <blockquote> <p><code>git-crypt</code> relies on git filters, which were not designed with encryption in mind. </p> <p>As such, <code>git-crypt</code> is not the best tool for encrypting most or all of the files in a repository.<br> Where <code>git-crypt</code> really shines is where most of your repository is public, but you have a few files (perhaps private keys named <code>*.key</code>, or a file with API credentials) which you need to encrypt. </p> <p>For encrypting an entire repository, consider using a system like <strong><a href="https://spwhitton.name/tech/code/git-remote-gcrypt/" rel="nofollow noreferrer"><code>git-remote-gcrypt</code></a></strong> instead.</p> </blockquote> <p>(see more at <a href="https://spwhitton.name/tech/code/git-remote-gcrypt/" rel="nofollow noreferrer"> spwhitton/ tech/ code/ git-remote-gcrypt</a>, from <strong><a href="https://spwhitton.name/" rel="nofollow noreferrer">Sean Whitton</a></strong>)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload