Simple git question

David Berube djberube at berubeconsulting.com
Wed Nov 4 14:40:16 EST 2020


If you want to skip the git pull, you can also do this:

git fetch
git reset --hard origin/master

... assuming your origin is called "origin", which is the default, and that
the branch in question is called "master." Note that this will set the
current branch to whatever "master" is on origin, so use git checkout first
if you're not on the right branch.

On Wed, Nov 4, 2020 at 2:35 PM Dan Coutu <coutu at snowy-owl.com> wrote:

> Bruce, there’s more than one way to do it. Of course.
>
> If you have not done a git commit of your changes then you can use ‘git
> stash’ to save your changes in the stash.
>
> If you have made commits, and your commits are up to date, then skip doing
> things with the stash.
>
>  If you want to have your changes available for later tinkering then make
> a branch at this point, checkout the branch, and apply your stash to it. So
> assuming you choose to name your branch mysandbox:
>
>         git branch mysandbox
>         git checkout my sandbox
>         git stash apply
>
> Checkout master to get back to the main branch (assuming that it is called
> master):
>
>         git checkout master
>
> You can then revert the files to the original clone of the repo like this:
>
>         git reset —hard HEAD
>
> Then do a
>
>         git pull
>
> To update your repo. That should get you where you want to be.
>
> I hope this helps!
>
> Dan
>
> > On Nov 4, 2020, at 1:43 PM, Bruce Labitt <bruce.labitt at myfairpoint.net>
> wrote:
> >
> > Guys & Gals, sorry for the elementary question.
> >
> > I have cloned a project that I am interested.  Along the way, I fiddled
> > with setting, mostly debug, but none of my changes are important.  I've
> > built the project and am using it.  I'd like to re download it from the
> > repo again, abandoning any changes that I have made.  A different person
> > has merged some changes and I want to try them.
> >
> > What is the best way to accomplish this?  My head spins with all the
> > pushing and pulling.  For some reason I am loath to nuke everything and
> > start over again.  Is there a slightly more graceful way to do this in
> > git without nuking?
> >
> > github's man area is not illuminating, instead they talk about all sorts
> > of corner case things rather than something this basic.
> >
> > Thanks all.
> >
> > _______________________________________________
> > gnhlug-discuss mailing list
> > gnhlug-discuss at mail.gnhlug.org
> > http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>
>
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>
-- 
David Berube
Berube Consulting
http://berubeconsulting.com
P.O Box 1746
Concord, NH 03302
United States
Tel: (603) 574-4766
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/pipermail/gnhlug-discuss/attachments/20201104/0d9bbedf/attachment.html 


More information about the gnhlug-discuss mailing list