alajmo / mani

:robot: CLI tool to help you manage repositories
https://manicli.com
MIT License
439 stars 23 forks source link

How do I choose which branch I want to pull? #73

Open swatchgame opened 1 year ago

swatchgame commented 1 year ago

I want to pull different branches for different projects, but even if I change the env value in the mani.yaml file, it still pulls the master or main branch by default when I do a mani sync.


projects:
  example:
    path: .

  pinto:
    path: frontend/pinto
    url: https://github.com/alajmo/pinto
    tags: [frontend]
    env:
      branch: feat/switch-ui

  dashgrid:
    path: frontend/dashgrid/../dashgrid
    url: https://github.com/alajmo/dashgrid
    tags: [frontend, misc]

  template-generator:
    url: https://github.com/alajmo/template-generator
    tags: [cli]
    env:
      branch: feat-replace

For pinto and template-generator, both projects still pull the main and master branches.
alajmo commented 1 year ago

There's no flag for specific git commands, but you can override it easily:

projects:
  pinto:
    path: frontend/pinto
    url: https://github.com/alajmo/pinto
    clone: git clone ${MANI_PROJECT_URL} --branch feat/switch-ui

  dashgrid:
    path: frontend/dashgrid/../dashgrid
    url: https://github.com/alajmo/dashgrid
    clone: git clone ${MANI_PROJECT_URL} --branch main

  template-generator:
    url: https://github.com/alajmo/template-generator
    clone: git clone ${MANI_PROJECT_URL} --branch feat-replace

I might add some standard git options later on.