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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:53:28+00:00 2026-05-24T07:53:28+00:00

As we consider moving from SVN to git at work, a coworker has raised

  • 0

As we consider moving from SVN to git at work, a coworker has raised the concern that a malicious or accident-prone developer could use git rebase to delete remote history from our shared repo.

Edit: As pointed out in the answers, entire branches could also be deleted from the remote repo with git push origin :branch-name.

Is this a realistic problem? If so, what approach can we take to prevent it?

  • 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-24T07:53:28+00:00Added an answer on May 24, 2026 at 7:53 am

    I tend to agree with your coworker that there is a problem here because:

    • no matter how well you trust your committers, there is always a possibility of human error
    • more onerous review processes (e.g. Gerrit) are not always appropriate
    • restoring from backups can be slow and a PITA

    Have you considered the receive.denyNonFastForwards and receive.denyDeletes config parameters? AFAICT these are available in Git 1.6 onwards.

    From Pro Git:

    If you rebase commits that you’ve already pushed and then try to push
    again, or otherwise try to push a commit to a remote branch that
    doesn’t contain the commit that the remote branch currently points to,
    you’ll be denied. This is generally good policy; but in the case of
    the rebase, you may determine that you know what you’re doing and can
    force-update the remote branch with a -f flag to your push command.

    To disable the ability to force-update remote branches to
    non-fast-forward references, set receive.denyNonFastForwards

    The other way you can do this is via server-side receive hooks, which I’ll cover in a bit. That approach lets you do more complex things like deny non-fast-forwards to a certain subset of users.

    As the author mentions, this rule can also be enforced via a receive hook (which is described later in Pro Git).

    These techniques should protect against accidental (or malicious) lost history in your shared repo.

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

Sidebar

Related Questions

I'm just moving from svn to git, and am keen to lay some good
I am in the process of moving from a username/password system to one that
I have a simple photo taking application that has the following design: [Consider the
(This is a post that I'm moving from ui stackexchange. ) We have some
Consider that I've a excel sheet in below format: person age Foo 29 Bar
Consider this scenario. I have my own website, that I use as my identifier,
consider the following pgSQL statement: SELECT DISTINCT some_field FROM some_table WHERE some_field LIKE 'text%'
Consider this - a base class A, class B inheriting from A, class C
I'm writing a wrapper that forks an execv() process. Output from the child is
What shortcut sets have you seen that you would consider logical and easy to

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.