Published on

TIL - Github and ASCIIbetically sorted folders

Authors

I am doing the advent of code this year and trying to maintain a repository of my solutions. On the 10th day, I created a folder containing the solutions for day 10, and pushed it on Github.

But to my surprise, I saw the randomly placed after day 1 and not day 9. Weird.

Weirdly placed folders

A bit of research on the internet showed that the folders are lexicographically sorted, in Github repositories.


Could've changed the filenames manually, but oh well.

$ for i in {1..9}; do mv -- day$i/ day$(printf '%02d\n' $i)/; done

Came up with this easy bash one liner and things worked fine.

Properly placed folders

Cheers!

Hi, In case you want to discuss anything about this post, you can reach out to me over here.