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

  • Home
  • SEARCH
  • 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 7867063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:36:25+00:00 2026-06-03T00:36:25+00:00

Alright – so I had a guy (in a school project – don’t panic)

  • 0

Alright – so I had a guy (in a school project – don’t panic) commit a full eclipse workspace complete with .class files and .settings/ directories. What I did was to clone the repo and make a .gitignore file and issue :

$ git reset --soft HEAD^
$ ... unstaged all files and added .gitignore and all files that it filtered in ...

Then I tried :

 $ git commit -c d1cf2d8173234b444c601d5e294a5cf6d790fa2c

Where the SHA is the SHA of the online commit. It won’t let me push :

Pushing to https://USERNAME@git.assembla.com/PROJECT.git To
https://USERNAME@git.assembla.com/PROJECT.git ! [rejected]
master -> master (non-fast-forward) error: failed to push some refs to
‘https://USERNAME@git.assembla.com/PROJECT.git’ To prevent you from
losing history, non-fast-forward updates were rejected Merge the
remote changes (e.g. ‘git pull’) before pushing again. See the ‘Note
about fast-forwards’ section of ‘git push –help’ for details.

My question is what should I have done instead ?

So how exactly should I go about deleting a commit in this scenario. Do not warn me that it shouldn’t be done – in this case it is very well acceptable, recommended and necessary to edit the history (I want to reclaim the space in the online repo). Also – I am not really worried how to force the push – I want the easier/cleaner way of replacing the remote HEAD commit with another.

It all starts with a clone…

  • 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-03T00:36:26+00:00Added an answer on June 3, 2026 at 12:36 am

    Aside from having to get the remote repo admins to allow you to rewind the “master” branch, see http://help.github.com/remove-sensitive-data/ and in particular, the “cleanup and reclaiming space” section.

    It’s often simplest to start over with a new remote and have the remote-admins delete the old one entirely, in cases like yours. 🙂

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

Sidebar

Related Questions

Alright. I'm attempting to complete a school assignment and cannot for the life of
Alright I don't see why this isnt working. It seems pretty simple. Here is
Alright I created some custom classes for my project sourced from this tutorial ,
Alright so I'm working on a project where I want the app to check
Alright so I just want to confirm something. I am creating a wrapper class
Alright so I have a project in NodeJS where I'm utilizing Sequelize for a
Alright so I have a simple has_many :through relationship in Rails 3.1 class Event
Alright, I have jQUery function which adds class to a div#float once div#floatLunch gets
Alright, I don't know if anyone has tried to do this yet, however. I
Alright so i need to open a .txt file that will be created in

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.