Some more notes for self, on how I set up version control for myself for Advent of Code (and other such challenges).
This is a bit complicated because the organisers of Advent of Code don't like people publishing the problem texts and data, but encourage people publishing the code of the solutions.
I get around this by having two repositories: a private wrapper repo that holds the data and text, and a code repo that holds the code. The code repo is held as a submodule of the wrapper.
Initialisation
Create the repos in Gitolite:
repo advent-of-code-25
RW+ = @developers
R = daemon
desc = Advent of Code solutions
repo advent-of-code-25-wrapper
RW+ = @developers
R = daemonThe lack of desc (description) means Gitolite keeps the repo private.
Clone the wrapper repo to the local machine.
~$ git clone git@git.njae.me.uk:everybody-codes-26-wrapper.git
Add .gitignore and similar files.
Add the submodule.
wrapper$ git submodule add -f git@git.njae.me.uk:everybody-codes-26.git codeAdd .gitignore and similar files in the submodule.
Make the first commit in the submodule.
code$ git add .
code$ git commit -m "Initial commit"Move back to the wrapper directory.
Add all the files.
wrapper$ git add .If you get a warning about "You have included a repository within another repository", follow the instructions given:
wrapper$ git rm --cached code
wrapper$ git submodule add -f git@git.njae.me.uk:everybody-codes-26.git code
In the code repo, set up Jujutsu.
code$ jj git init --colocate
code$ jj bookmark track main@origin
Working
Add some code, update the bookmark, push the changes
code$ jj commit -m "Done some work"
code$ jj bookmark set main -r @-
code$ jj git push
Add another remote
Create empty repos on Codeberg. Make the wrapper private, the code public.
wrapper$ git remote add codeberg ssh://git@codeberg.org/NeilNjae/everybody-codes-26-wrapper.git
wrapper$ git push -u codeberg main
in the code
code$ git remote add codeberg ssh://git@codeberg.org/NeilNjae/everybody-codes-26.git
code$ jj git push --remote codeberg --allow-new
After that, push to Codeberg with
code$ jj git push --remote codeberg