Home page logo

metasploit logo Metasploit mailing list archives

Re: resetting git
From: Tod Beardsley <todb () packetfu com>
Date: Mon, 17 Mar 2014 14:02:40 -0500

git clone --depth 1 is nice. Very shallow if you don't care about the past
too much.

On Mon, Mar 17, 2014 at 1:32 PM, Michael Schierl <schierlm () gmx de> wrote:

Am 16.03.2014 22:52, schrieb Robin Wood:
On 16 March 2014 21:49, Robin Wood <robin () digininja org> wrote:

All seemed to work except I had to do these in the other order:

$ git reset --hard upstream/master
$ git checkout master

Depending on what branch you were one before, you might have to reset
the freshly checked out master branch again, if you follow this route.

Should have elaborated, when I did it your way it complained about a
conflict that needed resolving before I could continue.

Sorry, did not think about that :-(

Doing the
reset seemed to fix that so the checkout could complete.

Another alternative (which is also handy in case you want to temporarily
checkout some different branch to test something there, without either
discarding or committing your changes first) is

$ git stash save

which puts your current changes away into the stash to be popped later
when you want to continue working on it. As we will remove all stashes
anyway later (by using "git stash clear") you could alternatively have
started with this command, followed by the checkout and the reset. Or
just reset it twice. Or reset whatever branch you are on, then delete
local master branch and create it fresh with

$ git checkout -b master

and then delete the branch you happened to be on before.

Lots of ways to get to the same goal. As Tod noted, just nuking your
current repo and cloning it again works too, but depending on your
Internet connection it may take a bit longer (downloading several
hundred megabytes).



"Tod Beardsley" <todb () packetfu com> | 512-438-9165 | @todb
   Such coin, plz send: DC2N24MkGxyweDUMJ8kiYHdCm3feErX69a

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]