Z
Z
zzox42017-10-26 21:01:29
git
zzox4, 2017-10-26 21:01:29

How to make a subfolder (submodule) that always contains the latest version?

Hello!
The repo has branches v1, v2, v3... (project versions), and there is a deploy folder that builds, deploys and configures the cluster.
What I want is that when I fix deploy and then switch to a different version, deploy must be up to date (the latest version).
I also don’t want to start a separate repo, so I made a submodule with a link to a separate submodule -> branch deploy branch, it seems to work more or less, but when I try to clone the repo, git cannot find the correct commits and gives a "tree error".
How to do something like this so that it would be convenient to use?
---
git addon can't load submodule because commit is not in master but in deploy:
$ git submodule update --init --recursive
Submodule 'sub' (repo) registered for path 'deploy'
Cloning into 'deploy'...
done.
fatal: reference is not a tree: ae223079f990dab540edea085ccd999f68994676
Unable to checkout 'ae223079f990dab540edea085ccd999f68994676' in submodule path 'deploy'
but it is specified in .gitmodule
[submodule "deploy"]
path = deploy branch =
./ deploy url = .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zemlyanoy, 2017-10-26
@Galamoon

git hooks to the rescue 7.3 Customizing Git - Hooks in Git

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question