[petsc-dev] moronic git

Barry Smith bsmith at mcs.anl.gov
Sun Nov 17 13:55:34 CST 2013


On Nov 17, 2013, at 1:39 PM, Aron Ahmadia <aron at ahmadia.net> wrote:

> > I made the changes in a branch than deleted the branch and expected the changes to go away
> 
> A branch is a pointer to commits.  It has nothing to do with your working tree.

  8 months later and now you tell me. So I’ve been doing it wrong all this time.

> 
> You want changes to go away, either use "git checkout file" for each file you want to reset, or "git reset --hard" to reset your entire working directory to a specific commit.
> 
> Different procedure for staged commits.  Are you trying to clean up your working directory or your staging area?
> 
> A
> 
> 
> On Sun, Nov 17, 2013 at 2:33 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
>   Yes, but why is there any changed shit in my current HEAD? I made the changes in a branch than deleted the branch and expected the changes to go away. How the hell do I make the changes go away that were in the branch I deleted? Is a branch then not the changes one made in it?
> 
> 
> 
> On Nov 17, 2013, at 1:09 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> 
> > Barry Smith <bsmith at mcs.anl.gov> writes:
> >
> >>  What part of delete does git not understand? How the f do I get rid of the damn branch completely  so I can create a new one with the same name and use it?
> >>
> >>
> >> ~/Src/petsc/src/ts/examples/tutorials/advection-diffusion-reaction  master $ git branch -D barry/saws-update
> >> Deleted branch barry/saws-update (was 9f236db).
> >
> > This really deleted the branch.
> >
> >> ~/Src/petsc/src/ts/examples/tutorials/advection-diffusion-reaction  master $ git branch barry/saws-update
> >
> > This created a new branch at your current HEAD.
> >
> >> ~/Src/petsc/src/ts/examples/tutorials/advection-diffusion-reaction  master $ git checkout barry/saws-update
> >> M       include/petscoptions.h
> >> M       include/petscviewer.h
> >> M       src/sys/classes/viewer/impls/string/stringv.c
> >> M       src/sys/objects/aoptions.c
> >> M       src/sys/objects/options.c
> >> M       src/sys/objects/pinit.c
> >> Switched to branch 'barry/saws-update'
> >
> > This checked out that branch, so HEAD points at the new branch, but the
> > working tree is the same, and Git tells you what is modified in your
> > working tree.
> 
> 




More information about the petsc-dev mailing list