Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > perl.module-authors > #3325

Re: What is best practice for 'git reset'?

Newsgroups perl.module-authors
Subject Re: What is best practice for 'git reset'?
Date 2017-04-20 15:34 +0200
Message-ID <5533199.U3i4oRGONI@ylum> (permalink)
References <20170419213058.21319.qmail@lists-nntp.develooper.com>
From domi.dumont@free.fr (Dominique Dumont)

Show all headers | View raw


On Wednesday, 19 April 2017 17:30:58 CEST James E Keenan wrote:
> Would the following be the recommend sequence of git commands?
> 
> $ git checkout master
> $ git checkout -b start-anew
> $ git reset --soft 2.12_002

git reset --soft does not change the working tree. So the change between 
2.12_002 and 2.12_004 would not be reverted.

I'd suggest instead to do a git revert like:
$ git revert -n 2.12_002..master

This command will also revert 2.12_002. If this is not desirable, you will 
have to find the first commit you want to revert and do:

$ git revert -n <first-bad-commit>..master

Then you can go on with what you suggest below.

> $ git commit -m "Rewind to tag 2.12_002"
> # hack, hack, hack
> $ git add ...
> $ git commit -m "Slight touchups to what was 2.12_002"
> $ git checkout master
> $ git merge start-anew
> $ git tag "2.12_005"

HTH

-- 
 https://github.com/dod38fr/   -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/  -o-   irc: dod at irc.debian.org

Back to perl.module-authors | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

What is best practice for 'git reset'? jkeenan@pobox.com (James E Keenan) - 2017-04-19 17:30 -0400
  Re: What is best practice for 'git reset'? domi.dumont@free.fr (Dominique Dumont) - 2017-04-20 15:34 +0200

csiph-web