Still see old commits in 'Activity' after force push #125351
Answered
by
arashtabaa
gudzilla
asked this question in
Repositories
-
Beta Was this translation helpful? Give feedback.
Answered by
arashtabaa
May 23, 2024
Replies: 2 comments 4 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Hi. I recently did a git push --force and now most of my recent commits are gone. They are not viewable on the webUI or with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


When you use git push --force, you're indeed overwriting the history of the branch on the remote repository with your local history. However, GitHub doesn't immediately remove the old commits from the "Active" tab in the repository interface. This is because Git, by design, keeps a reference to old commits for a certain period of time, even after they've been removed from the active branch.
The reason behind this behavior is to provide a safety net for developers. If you accidentally force push and delete important commits, they can still be recovered within a certain time frame, usually 30 days by default, through Git's reflog or other recovery mechanisms. During this time, the old commi…