Working with git: git equivalent of "svn up -r..."

rod rod at pu-gh.com
Fri Nov 25 15:25:52 CET 2016


Depends what you want to do when you get there really.

Disclaimer: --hard will wipe out any changes you have in your WC

This will move your current branch to point to that commit...

git reset --hard 72164060176afd82227b03e05aede0ce292f093f

But this applies to the whole git checkout, not a subtree (as i think i
remember you could do with svn...)



On Fri, Nov 25, 2016 at 2:06 PM Ryan Schmidt <ryandesign at macports.org>
wrote:

> I just committed an update to the lighttpd port, but now I want to get
> back to the previous version.
>
> With svn, I would have done:
>
> cd $(port dir lighttpd)
> svn up -r 151090
>
> How do I do this with git?
>
> I tried:
>
> cd $(port dir lighttpd)
> git checkout 72164060176afd82227b03e05aede0ce292f093f
>
> git complained:
>
> error: Your local changes to the following files would be overwritten by
> checkout:
>         net/curl/Portfile
> Please commit your changes or stash them before you switch branches.
> Aborting
>
> I don't want to commit or stash or do anything else to files not in the
> current directory. I only want the files in the current directory
> temporarily rolled back to a previous state for testing.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20161125/3886bcf3/attachment.html>


More information about the macports-dev mailing list