Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 678697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:10:42+00:00 2026-05-14T01:10:42+00:00

Is it possible to automatically encrypt files via ‘git push’ before transferring to a

  • 0

Is it possible to automatically encrypt files via ‘git push’ before transferring to a remote repository? And automatically decode them while ‘git pull’.

I.e, if I have some remote server with shared access with git repository there, and I don’t want our project to be stolen without a permission…
Maybe there is some special git-hooks before push and after pull?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:10:42+00:00Added an answer on May 14, 2026 at 1:10 am

    Yes and no.

    You could try to depend on hook but that supposes they are installed at the remote locations, and that is not always reliable.

    Another way to achieve almost the same effect would be by using a smudge/clean attribute filter driver, but not for a full repo.

    smudge/clean

    (Source: Pro Git book: Customizing Git – Git Attributes)

    That way the smudge script is able decode the files, while the clean script would encode them.
    Again, that could work for a few sensitive files, not for a full repo.

    Off course, those scripts would not be in the repository itself, and would be managed/communicated by another way.

    As Alkaline points out in the comments, that idea does not scale for a repo, as the main git maintainer Junio C. Hamano comments back in 2009:

    As the sole raison d’etre of diff.textconv 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.

    The above config may appear to work, but if you really want an encrypted repository, you should be using an encrypting filesystem.
    That would give an added benefit that the work tree
    associated with your repository would also be encrypted
    .


    Even though it does not scale to a full repo, the idea was implemented (3 years later in 2013) with git-crypt, as detailed in Dominic Cerisano‘s answer.
    git-crypt uses a content filter driver (implemented in cpp, with commands.cpp setting up your .gitattributes with the relevant smudge and clean filter commands).
    As any content filter driver, you can then limit the application of git-crypt to the set of files you want, in the same .gitattributes file:

    secretfile filter=git-crypt diff=git-crypt
    *.key filter=git-crypt diff=git-crypt
    

    As mentioned in the README:

    git-crypt relies on git filters, which were not designed with encryption
    in mind.

    As such, git-crypt is not the best tool for encrypting most or
    all of the files in a repository.
    Where git-crypt really shines is where most of your repository is public, but you have a few files (perhaps private keys named *.key, or a file with API credentials) which you need to encrypt.

    For encrypting an entire repository, consider using a system like git-remote-gcrypt instead.

    (see more at spwhitton/ tech/ code/ git-remote-gcrypt, from Sean Whitton)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to automatically transfer/ftp files to a server, every time I commit
Possible Duplicate: Automatically re-direct a user when session Times out or goes idle… I
Is it possible to automatically hide an element in a web page 5 seconds
Question: Is it possible to (automatically) change the base class of auto-generated domain objects
is it possible to automatically export mysql database in phpmyadmin
Is it possible to automatically create Word documents which include list fields from a
is it possible to automatically resize div and its content when browser window is
Is it somehow possible to automatically generate a YAML schema file or models from
Is there any possible way to automatically append all strings/etc to a textbox(or other
Is it possible to let the IDE automatically implement inherited abstract methods in Delphi

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.