Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8704283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:03:45+00:00 2026-06-13T03:03:45+00:00

A colleague has done a few things I told them not to do: forked

  • 0

A colleague has done a few things I told them not to do:

  • forked the origin repo online
  • cloned the fork, added a file that shouldn’t have been added to that local repo
  • pushed this to their fork

I’ve then:

  • merged the changes from the fork and found the file

I want to remove this from:

  • my local repo
  • the fork
  • their local repo

I have a solution for removing something from the history, taken from Remove file from git repository (history). What I need to know is, should my colleague also go through this, and will a subsequent push remove all info from the fork? (I’d like an alternative to just destroying the fork, as I’m not sure my colleague will do this)

SOLUTION: This is the shortest way to get rid of the files:

check .git/packed-refs - my problem was that I had there a refs/remotes/origin/master line for a remote repository, delete it, otherwise git won't remove those files
(optional) git verify-pack -v .git/objects/pack/#{pack-name}.idx | sort -k 3 -n | tail -5 - to check for the largest files
(optional) git rev-list --objects --all | grep a0d770a97ff0fac0be1d777b32cc67fe69eb9a98 - to check what files those are
git filter-branch --index-filter 'git rm --cached --ignore-unmatch file_names' - to remove the file from all revisions
rm -rf .git/refs/original/ - to remove git's backup
git reflog expire --all --expire='0 days' - to expire all the loose objects
(optional) git fsck --full --unreachable - to check if there are any loose objects
git repack -A -d - repacking the pack
git prune - to finally remove those objects
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:03:47+00:00Added an answer on June 13, 2026 at 3:03 am

    Well, pushing will definitely cause little trouble as you won’t have a linear history. Using --force flag to push and pull should do the job.

    Although, if not, ask your colleague to reset their branch at the first known commit git reset --hard <initial commit sha-1> and then ask them to pull. This way should work as the reset won’t properly be a change in the local branch; the branch will only be marked as behind it’s remote counterpart by lots of commit. Then, fetching and merging will go easy as they’ll go up all the way with a linear history.

    But of course, such a manoeuvre need organization/timing between your team.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not very familiar with RoR but my colleague has written this code
My SEO colleague has fired in a few url requests that involve moving www.mydomain.co.uk/news
A colleague has a batch script program which needs to to run on a
A new colleague has just suggested using named HQL queries in Hibernate with annotations
A colleague of mine has written a DLL file for me to use called
I have a problem that has just come up with a colleague of mine
A colleague has passed me an interesting code sample that crashes with an InvalidProgramException
A colleague has installed VS2008 Team Explorer (as part of his role in Scrum)
Using google docs, a colleague has created a plot similar to: I'm trying to
I'm re-writing an Asp.Net project that a colleague had done a prototype version of.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.