Let's see what it is
- Create two git repo
sub
&test
mkdir test sub cd test && git init && touch README && git add README && git commit -m "initialize the git repo" && cd .. cd sub && git init && touch README && git add README && git commit -m "initialize the sub git repo" && cd ..
- Move the
sub
repo intotest
mv sub test cd test git add sub git commit -m "add sub directory"
I want to treat them as one git repo and push them remotely, but now the files under sub
directory can not be included ?
How can I achieve this in simple way like treat sub as normal directory ?
Use case for this
I try to add my jenkins data folder (JENKINS_HOME
) into docker images using Dockerfile
for demo. (ADD JEKINS_HOME /opt/jenkins
)
JENKINS_HOME
Dockerfile
My jenkin has scriptler plugin which contains the git repo for its purpose. Then it exists in my docker image git repo like below
$ find jenkins-docker ./.git ./.git/.. (skipped ./Dockerfile ./JENKINS_HOME ./JENKINS_HOME/scriptler ./JENKINS_HOME/scriptler/scripts ./JENKINS_HOME/scriptler/scripts/.git ./JENKINS_HOME/scriptler/scripts/.git/... (skipped) ./JENKINS_HOME/scriptler/scripts/Sample.groovy ./JENKINS_HOME/... (skipped) ./README