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 6572931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:04:06+00:00 2026-05-25T15:04:06+00:00

If I push a bad initial commit (or more than one) to a remote

  • 0

If I push a bad initial commit (or more than one) to a remote repository and want to just clear it / destroy it – can I do it by a command?

It’s important to totally remove it from server so it doesn’t use disk space.

E.G. Today I pushed a whole Visual Studio project with included dlls, sdfs and so on. Firstly this files are quite big, secondly some of them are modified by VS of other developers and than can’t be merged. This made me google a little bit and I found out these files should be ignored. But the first commit already clutters my repository. I want to remove this and free the disk space.

It’s possible to remove git repo and add it again via host’s website (assembla), but this doesn’t sound like solution to me.. Is there a more professional way?


UPDATE:

I tried suggestions from the answer below but it didn’t work:
‘git push -f’ ‘git push –force’ ‘git push origin -f’ ‘git push origin –force’
resulted in:

$ git push --force
Counting objects: 19, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (19/19), done.
Writing objects: 100% (19/19), 6.85 KiB, done.
Total 19 (delta 3), reused 0 (delta 0)
remote: error: denying non-fast-forward refs/heads/master (you should pull fir
)
To git@git.assembla.com:xxxxx.git
 ! [remote rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@git.assembla.com:xxxxx.git'
  • 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-05-25T15:04:06+00:00Added an answer on May 25, 2026 at 3:04 pm

    You can force push the “correct” repo with git push -f. Depending on the host, the loose objects will be cleaned up when git gc is ran. update: According to this you can’t force the git gc in assembla.

    If you want them cleaned up immediately and assembla doesn’t allow you to force a git gc, the other option is to delete the repo and push a new one.

    In addition, as Ryan stated in the comments, be sure to let everyone know that may have cloned the repo, that you re-wrote history.

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

Sidebar

Related Questions

I am having bad performance with jqGrid when it loads more than 100 rows.
The remote repository contains a bad version. I have the copy of a good
I have a weird issue that's probably more of a bad coding than anything
Mercurial supports push-style cloning of repositories to remote hosts, however newly cloned repositories don't
Read about Server push here . I want to push data to client from
I want to use push notification in my app.i want to know that do
I have a centralized Mercurial repository which I want to provide access to via
first excuse me for my bad english! I want to search in pdf document
I had a repository that had some bad commits on it (D, E and
I've been looking for a simpler way than Comet or Long-Polling to push some

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.