#!/bin/bash

rm -rf a_submodule a_repo

mkdir a_submodule
cd a_submodule
git init
touch a_file_in_a_submodule
git add a_file_in_a_submodule
git commit -m "add a file in a submodule"
cd ..

mkdir a_repo
cd a_repo
git init

touch a_file
git add a_file
git commit -m "add a file"

git branch test
git checkout test

mkdir a_submodule
touch a_submodule/content
git add a_submodule/content
git commit -m "add a regular folder with name a_submodule"

echo "123" > a_file
git add a_file
git commit -m "modify a file"

git checkout master

git submodule add ../a_submodule a_submodule
git submodule update a_submodule
git commit -m "add a submodule info folder with name a_submodule"

# Trying to cherry-pick modification of a file from test branch.
git cherry-pick test

# some debug
git status

gitk --all
