git gc –aggressive push to server?

It seems like git gc --aggressive really cleans up my repo, but when I do git push everything is already up-to-date. Is there a way to clean up the server?

  • Git ask me to commit ignored files
  • Git submodules, switching branches, and the recommended way to include external JS dependencies (oh my)
  • Why Git suggest “changes” to me on a (theoretically) ignored file (path)?
  • How to checkout a commit's child?
  • Make git push fail when there are uncommitted changes
  • How do I SVN-commit multiple git-svn repositories simultaneously?
  • Should I exclude Aurelia scripts folder in .gitignore?
  • Cannot push new branch to git server
  • Git failed to push some refs?
  • Xcode 4, git and mergeing projectfile!
  • capistrano rails 3 git error - fatal: Not a git repository (or any of the parent directories): .git
  • git svn fetch not working
  • 3 Solutions collect form web for “git gc –aggressive push to server?”

    I know that Github will run git gc periodically as the Github support mentions in this thread.

    I don’t know if you can force it yourself though.
    I didn’t see such a service in the Github hooks.

    I believe that pushing your changes will only add new commits (as necessary to reach the branches you are pushing); it will not delete them. This is corroborated by this github support page on deleting sensitive data:

    Be warned that force-pushing does not erase commits on the remote repository, it simply introduces new ones and moves the branch pointer to point to them. If you are worried about users accessing the bad commits directly via SHA1, you will have to delete the repository and recreate it.

    So if you can’t wait for GitHub’s periodic gc, then you have to recreate.

    You’ll have to run the same command on the server side as well. Most people just set up a cron job or similar to do this sort of housekeeping periodically.

    Git Baby is a git and github fan, let's start git clone.