Search code examples
fossil

FOSSIL: file outside of checkout tree


As I understand the directories of each file fossil.exe, repository-file and files (to be versioned) can be in totally different pathes, is that right?

However, I get the following error:

file outside of checkout tree: path_to_file\filename

My structure is as follows:

FOSSIL\fossil.exe

NewFolder\repo.fossil

NewFolder\Subfolder\sample_table.csv

When opening the repo and then running fossil add full_path\sample_table.csv I get the above mentioned error.


Solution

  • A few things:

    • It doesn't matter where the fossil executable is located, as long as it's somewhere in the search path (otherwise you have to use the full path every time).
    • It doesn't really matter where the repository file is located either, as long as it doesn't move after you've opened it. (If you do want to move it, close the repository first).
    • You're missing a work directory. You need to open the repository first, into a work directory (also called the checkout tree). That work directory will be where you'll be working on your files.

    In the situation you describe, you'd need to run the following command:

    cd <topmost folder of your code>
    fossil open NewFolder\repo.fossil
    

    After that, you can do whatever you need in that folder (and its subfolders), and anytime you perform a commit or checkin, the changes you've made will end up in the repository.

    fossil add NewFolder\Subfolder\sample_table.csv
    fossil commit --comment "Added sample table"
    

    There's usually no reason to close the working directory again; except perhaps if you want to move the repository: you'd then use fossil close to close the working directory, move the repository, and then use fossil open <new_repo_path> from the working directory again.

    Note that the repository can be located somewhere else entirely; and also that a single repository can be opened into several different work directories at the same time.