@classmethod
    def _write_git_file_and_module_config(cls, working_tree_dir, module_abspath):
        git_file = os.path.join(working_tree_dir, '.git')
        rela_path = os.path.relpath(module_abspath, start=working_tree_dir)
        fp = open(git_file, 'wb')
        fp.write(("gitdir: %s" % rela_path).encode(defenc))
        fp.close()

        writer = GitConfigParser(os.path.join(module_abspath, 'config'), read_only=False, merge_includes=False)
        writer.set_value('core', 'worktree',
                         to_native_path_linux(os.path.relpath(working_tree_dir, start=module_abspath)))
        writer.release()

    #{ Edit Interface
Writes a .git file containing a (preferably) relative path to the actual git module repository.
dataset/ETHPy150Open gitpython-developers/GitPython/git/objects/submodule/base.py/Submodule._write_git_file_and_module_config