Git Issue in organising numbered folders

Hello All,

I have an issue in pushing the 100th project subfolder under a Github repo. I am naming each project using number sequence starting from 01, 02…09, 10, 11 and so on but when I try to push the 100th Project subfolder, it’s sitting after 10th, like 09, 10, 100, 11…etc. So, I tried renaming it with 0100 but that’s taking it to 01, 0100, 02…etc. Basically, I want my 100th subfolder project should come after 99th, like 98, 99, 100,… etc. Any solution for this?

Appreciate any help.

Many thanks

It’s because of the difference in how you see those numbers and how the computer sees them.

The computer will arrange them in order based on the character, but it does not innately recognise that you’ve labelled them with numbers.

In a run of folders which are all numbered, providing each number is the same length you will get the desired result. What I mean by this is that if your folders looked like this:

...
097
098
099
100
101
102
...

because 0 is less than 1, so it gets sorted correctly.

The only way you’ll fix it, I’m afraid, is by re-naming every other folder to make the number 3-digits… and then that will only work until you reach 1000 (if you get that far) at which point you’ll have the same issue…

3 Likes

Thank you so much @thepitycoder. Appreciate your response. I understand the logic now. On another note, that’s a colossal work to rename every folder from the start: 001 to 099 and then 100. I never thought I will push myself to push 100th project in my repo but I am glad I did it and so learned a new thing.

Cheers. :slightly_smiling_face:

3 Likes