Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

371
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!