Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How far back does Github track commits?

I'm sure this information is out there somewhere, but I've been searching for quite awhile and haven't come up with anything. My question is, how far back does Github track your commits? Like if I screwed up my code and wanted to revert back to how I had it many commits ago, how far back would the history go?

like image 402
Henry Bergin Avatar asked Jul 26 '26 22:07

Henry Bergin


1 Answers

History goes back to when you started your project in Git. Doesn't matter when it was added to Github, Github just stores the repo. For example, here's one of my projects which predates Github by half a year. Here's a commit from 2001 before Git even existed, that repository has been migrated through several version control systems.

Instead, Github limits the size of the repository. There's a soft limit of 1 GB per repository, meaning Github will request you reduce the repository size rather than simply deny it, and a hard limit of 100 MB per file. Note that's the total size of the repository, not the size of the current checkout.

If you have to store very large files, use git-lfs (Large File Storage).

As a side note, because of the way Git works, you cannot drop or alter old commits without altering every commit after it. Github can't quietly truncate your history even if it wanted to.

like image 58
Schwern Avatar answered Jul 29 '26 14:07

Schwern



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!