{"thread":{"id":"16560","subject":"Overwrite master","startedAt":"2008-12-02T16:10:56Z","lastAt":"2008-12-02T20:28:43Z","messageCount":4,"participants":["Nicholas Wieland","Peter Harris"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"96959","messageId":"D1AC0A41-E89A-4B53-A449-DA9C4422998E@zooppa.com","threadId":"16560","inReplyTo":null,"subject":"Overwrite master","fromName":"Nicholas Wieland","fromEmail":"nicholas.wieland@gmail.com","sentAt":"2008-12-02T16:10:56Z","receivedAt":"2008-12-02T16:10:56Z","isPatch":false,"sender":{"key":"nicholas.wieland@gmail.com","avatar":null},"body":"Hi *,\nI need to overwrite my master branch with another branch. I've already  \ncreated a backup branch of my master.\nI tried a merge but it's just too big to handle, and I don't really  \ncare about what's in my master now.\nThe reason I want to do something like this is to be able to branch  \ndirectly from my master in the future and merge back smaller branches  \n(basically what I didn't do this time ...) instead of trying to merge  \nback a huge one. This time I've used git like I've used svn, my bad,  \nvery stupid thing ...\nHope my question is clear.\n\nTIA,\n   ngw\n"},{"id":"96962","messageId":"eaa105840812020832p395ecefdq57e62f95182a3557@mail.gmail.com","threadId":"16560","inReplyTo":"D1AC0A41-E89A-4B53-A449-DA9C4422998E@zooppa.com","subject":"Re: Overwrite master","fromName":"Peter Harris","fromEmail":"git@peter.is-a-geek.org","sentAt":"2008-12-02T16:32:29Z","receivedAt":"2008-12-02T16:32:29Z","isPatch":false,"sender":{"key":"git@peter.is-a-geek.org","avatar":null},"body":"On Tue, Dec 2, 2008 at 11:10 AM, Nicholas Wieland wrote:\n> Hi *,\n> I need to overwrite my master branch with another branch. I've already\n> created a backup branch of my master.\n\nWhile on master,\n\"git reset --hard <newbranch>\"\n\nOr while on a different branch,\ngit branch -D master\ngit branch master <newbranch>\n\nPeter Harris\n"},{"id":"96978","messageId":"67A24C29-12A6-43B0-95D5-70910C5F8841@gmail.com","threadId":"16560","inReplyTo":"eaa105840812020832p395ecefdq57e62f95182a3557@mail.gmail.com","subject":"Re: Overwrite master","fromName":"Nicholas Wieland","fromEmail":"nicholas.wieland@gmail.com","sentAt":"2008-12-02T20:09:45Z","receivedAt":"2008-12-02T20:09:45Z","isPatch":false,"sender":{"key":"nicholas.wieland@gmail.com","avatar":null},"body":"Il giorno 02/dic/08, alle ore 17:32, Peter Harris ha scritto:\n\n> On Tue, Dec 2, 2008 at 11:10 AM, Nicholas Wieland wrote:\n>> Hi *,\n>> I need to overwrite my master branch with another branch. I've  \n>> already\n>> created a backup branch of my master.\n>\n> While on master,\n> \"git reset --hard <newbranch>\"\n>\n> Or while on a different branch,\n> git branch -D master\n> git branch master <newbranch>\n\nThat's what I tried.\nUnfortunately I don't know where to go after:\n\nngw@slicingupeyeballs ~/zooppa$ git commit\n# On branch master\n# Your branch and 'origin/master' have diverged,\n# and have 444 and 25 different commit(s) each, respectively.\n#\nnothing to commit (working directory clean)\n\nDo I have to push ? If I pull it tries to merge ...\n\n\nThanks a lot for your time,\n   ngw\n\n"},{"id":"96981","messageId":"eaa105840812021228v6f6e1252l5099f5dad325f99@mail.gmail.com","threadId":"16560","inReplyTo":"67A24C29-12A6-43B0-95D5-70910C5F8841@gmail.com","subject":"Re: Overwrite master","fromName":"Peter Harris","fromEmail":"git@peter.is-a-geek.org","sentAt":"2008-12-02T20:28:43Z","receivedAt":"2008-12-02T20:28:43Z","isPatch":false,"sender":{"key":"git@peter.is-a-geek.org","avatar":null},"body":"On Tue, Dec 2, 2008 at 3:09 PM, Nicholas Wieland wrote:\n> Il giorno 02/dic/08, alle ore 17:32, Peter Harris ha scritto:\n>\n>> On Tue, Dec 2, 2008 at 11:10 AM, Nicholas Wieland wrote:\n>>>\n>>> Hi *,\n>>> I need to overwrite my master branch with another branch. I've already\n>>> created a backup branch of my master.\n>>\n>> While on master,\n>> \"git reset --hard <newbranch>\"\n>\n> That's what I tried.\n> Unfortunately I don't know where to go after:\n>\n> ngw@slicingupeyeballs ~/zooppa$ git commit\n> # On branch master\n> # Your branch and 'origin/master' have diverged,\n> # and have 444 and 25 different commit(s) each, respectively.\n> #\n> nothing to commit (working directory clean)\n\nThat means your tracking branch is different from your local branch, by a lot.\n\n> Do I have to push ? If I pull it tries to merge ...\n\nIf you push, it will be denied (non-fast-forward).\n\nIf you force push, your state will be as you expect. Be aware that\nyou're creating trouble for everyone else who uses 'origin' if you\nforce push. Also be aware that you will be undoing any changes that\nanyone else has pushed to origin in the mean time.\n\nBasically, history is history. If you don't want to cause problems for\nthe other users of 'origin', you may have to live with history as it\nis. You won't be able to overwrite master, although you will probably\ntry to be more careful in the future.\n\nPeter Harris\n"}]}