git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Peter Harris" <git@peter.is-a-geek.org>
To: "Nicholas Wieland" <nicholas.wieland@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Overwrite master
Date: Tue, 2 Dec 2008 15:28:43 -0500	[thread overview]
Message-ID: <eaa105840812021228v6f6e1252l5099f5dad325f99@mail.gmail.com> (raw)
In-Reply-To: <67A24C29-12A6-43B0-95D5-70910C5F8841@gmail.com>

On Tue, Dec 2, 2008 at 3:09 PM, Nicholas Wieland wrote:
> Il giorno 02/dic/08, alle ore 17:32, Peter Harris ha scritto:
>
>> On Tue, Dec 2, 2008 at 11:10 AM, Nicholas Wieland wrote:
>>>
>>> Hi *,
>>> I need to overwrite my master branch with another branch. I've already
>>> created a backup branch of my master.
>>
>> While on master,
>> "git reset --hard <newbranch>"
>
> That's what I tried.
> Unfortunately I don't know where to go after:
>
> ngw@slicingupeyeballs ~/zooppa$ git commit
> # On branch master
> # Your branch and 'origin/master' have diverged,
> # and have 444 and 25 different commit(s) each, respectively.
> #
> nothing to commit (working directory clean)

That means your tracking branch is different from your local branch, by a lot.

> Do I have to push ? If I pull it tries to merge ...

If you push, it will be denied (non-fast-forward).

If you force push, your state will be as you expect. Be aware that
you're creating trouble for everyone else who uses 'origin' if you
force push. Also be aware that you will be undoing any changes that
anyone else has pushed to origin in the mean time.

Basically, history is history. If you don't want to cause problems for
the other users of 'origin', you may have to live with history as it
is. You won't be able to overwrite master, although you will probably
try to be more careful in the future.

Peter Harris

      reply	other threads:[~2008-12-02 20:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 16:10 Overwrite master Nicholas Wieland
2008-12-02 16:32 ` Peter Harris
2008-12-02 20:09   ` Nicholas Wieland
2008-12-02 20:28     ` Peter Harris [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eaa105840812021228v6f6e1252l5099f5dad325f99@mail.gmail.com \
    --to=git@peter.is-a-geek.org \
    --cc=git@vger.kernel.org \
    --cc=nicholas.wieland@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).