Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

370
Visualizações
Is there a way to mount a git branch (read only) on linux?

Setup: At work we have a git repo where our scripts are. These scripts need to be accessible on all our client linux machines (~400). The current solution is to have a file server, which regularly pulls the main branch. This then is mounted (nfs + autofs).

Question: Is there an easy way to mount a remote git branch read only?

I'm aware of GitFS, but this seems to be overkill. I'm looking for something lightweight, preferably in-memory, i.e. without checking stuff out on disk. I only need access to one branch, no history.

Edit: To clearify this: I want to avoid pulling and cronjobs and stuff like this. Best would be something which transparently mounts a remote git repository much like a read only nfs mount.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Question: Is there an easy way to mount a remote git branch read only?

Yes you can do it in several ways. Both bundle & archive are a read-only repository.

git bundle

# Clone the desired branch (-b flag)
# and pack it into a bundle with the desired name
git clone repo.bundle repo-copy -b master

The output of this is a single file containing the desired branch in a read-only mode since it's not a git repository.


git archive

similar to the above bundle command

# Create a tar archive that contains the contents of the latest commit 
# on the current branch, and 
#extract it in the /var/tmp/junk directory.
git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda