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

166
Views
Montar ramas de git en un contenedor

Tengo un repositorio de git con 2 ramas distintas, por ejemplo, master y foo :

 mkdir test && cd test git init echo master > master git add . && git commit -m "init master" git checkout -b foo rm master echo foo > foo git add . && git commit -m "init foo"

Ahora quiero montar master y foo en un contenedor como volúmenes separados, para tener esta arquitectura en mi contenedor:

 . ├── foo │  └── foo └── master └── master

¿Es posible?

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Podrías usar dos árboles de trabajo de git . Los árboles de trabajo le permiten tener más de una rama desprotegida en diferentes rutas.

 $ git status On branch master … $ git worktree add ../develop Preparing ../develop (identifier develop) HEAD is now at fbbbc04 netcat6 for gnks $ git -C ../develop status On branch develop nothing to commit, working tree clean

Luego monte esos directorios en su contenedor.

about 4 years ago · Santiago Trujillo Report

0

Necesitaría dos clones, uno con master desprotegido y otro con foo desprotegido. Pueden ser clones superficiales para ahorrar espacio.

 git clone file:///full/path/to/the/repo --depth 1 --branch master master git clone file:///full/path/to/the/repo --depth 1 --branch foo foo

Podría tener más sentido tener solo un clon dentro de la VM y usarlo como un clon de git normal.

about 4 years ago · Santiago Trujillo Report

0

No creo que puedas montar ramas de git tal cual. Sin embargo, si la respuesta de Schern no es suficiente (es posible que desee tener un repositorio común y dos directorios de trabajo), recomendaría investigar esto: https://git-scm.com/docs/git-worktree

De esa manera, ambos directorios compartirán el mismo directorio .git (uno será una instrucción para que git busque en el otro)

about 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!