From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steinar Bang Newsgroups: gmane.emacs.devel Subject: Re: git question: how do I get a specific git version into my working directory? Date: Sat, 18 Apr 2015 14:18:59 +0200 Organization: Probably a good idea Message-ID: <86sibx7hos.fsf@dod.no> References: <20150418103301.GB4182@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1429359562 23396 80.91.229.3 (18 Apr 2015 12:19:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Apr 2015 12:19:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 18 14:19:15 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YjRiM-0002bx-Jj for ged-emacs-devel@m.gmane.org; Sat, 18 Apr 2015 14:19:14 +0200 Original-Received: from localhost ([::1]:45544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjRiL-0000zK-LL for ged-emacs-devel@m.gmane.org; Sat, 18 Apr 2015 08:19:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjRiJ-0000zF-3y for emacs-devel@gnu.org; Sat, 18 Apr 2015 08:19:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjRiF-0001bb-VR for emacs-devel@gnu.org; Sat, 18 Apr 2015 08:19:11 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjRiF-0001bX-OT for emacs-devel@gnu.org; Sat, 18 Apr 2015 08:19:07 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YjRiE-0002Vr-03 for emacs-devel@gnu.org; Sat, 18 Apr 2015 14:19:06 +0200 Original-Received: from cm-84.208.248.210.getinternet.no ([84.208.248.210]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Apr 2015 14:19:05 +0200 Original-Received: from sb by cm-84.208.248.210.getinternet.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Apr 2015 14:19:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 33 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cm-84.208.248.210.getinternet.no Mail-Copies-To: never User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4 (windows-nt) Cancel-Lock: sha1:abor3bCXSyfmFo2hIWgIUEZTne0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:185569 Archived-At: >>>>> Alan Mackenzie : > Hello, Emacs. > A simple question (I hope): How do I get a specific SW revision into my > working directory. I want to do something like this: > git 7e09ef09a479731d01b1ca46e94ddadd73ac98e3 > git checkout doesn't seem to be the thing. "git checkout 7e09ef09a479731d01b1ca46e94ddadd73ac98e3" should work. What result do you get and what were you expecting? Do you have any uncommitted files it refuses to overwrite? If so, try git stash git checkout 7e09ef09a479731d01b1ca46e94ddadd73ac98e3 git stash pop (don't stash if you have staged files, I think you have uncovered a bug there...) > Neither does git revert. What is here? The command is "checkout". WARNING! Dangeous work-losing command ahead! There is also git reset --hard 7e09ef09a479731d01b1ca46e94ddadd73ac98e3 which will overwrite anything uncommitted and set your workstate to the version described in 7e09ef09a479731d01b1ca46e94ddadd73ac98e3. If you just want to apply that commit, do: git cherry-pick 7e09ef09a479731d01b1ca46e94ddadd73ac98e3