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: Stash Date: Mon, 06 Apr 2015 08:50:15 +0200 Organization: Probably a good idea Message-ID: <86fv8d7ntk.fsf@dod.no> References: <86sice77h0.fsf@dod.no> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1428303015 16811 80.91.229.3 (6 Apr 2015 06:50:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Apr 2015 06:50:15 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 06 08:50:08 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 1Yf0rH-0001M1-Hs for ged-emacs-devel@m.gmane.org; Mon, 06 Apr 2015 08:50:07 +0200 Original-Received: from localhost ([::1]:38666 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yf0rG-0003l8-Rq for ged-emacs-devel@m.gmane.org; Mon, 06 Apr 2015 02:50:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yf0rD-0003l3-1v for emacs-devel@gnu.org; Mon, 06 Apr 2015 02:50:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yf0r9-00071q-QN for emacs-devel@gnu.org; Mon, 06 Apr 2015 02:50:02 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:35731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yf0r9-00071m-Jr for emacs-devel@gnu.org; Mon, 06 Apr 2015 02:49:59 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Yf0r8-0001He-OV for emacs-devel@gnu.org; Mon, 06 Apr 2015 08:49:58 +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 ; Mon, 06 Apr 2015 08:49:58 +0200 Original-Received: from sb by cm-84.208.248.210.getinternet.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Apr 2015 08:49:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 46 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:yV3GLcmtMeqKaOwHB6X5Gtvum8c= 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:185002 Archived-At: >>>>> Richard Stallman : > I did >> git reset --hard HEAD > since I had installed all my changes. > Then I did 'git pull' and it reported a lot of things. > Then I did 'git status' which produced this: > # On branch master > # Your branch is ahead of 'origin/master' by 2 commits. > # > nothing to commit (working directory clean) > What does that second line "ahead of" mean? It means that the branch master has two commits that aren't in origin/master (which is your local copy of what's on savannah). > Is it a problem? I don't think so. I think they are probably artifacts of two of the pull commands done, so I think you probably won't need them. The following is a way to remove the two commits from master in your git repository, but at the same time put them in a local branch, where they can be examined later: git checkout -b two-unexpected-commits-on-master git checkout master git fetch git reset --hard origin/master If you decide ahead of time that you don't care about the two commits, drop the first command ("git checkout -b two-unexpected-commits-on-master"). Note that the "git reset --hard origin/master" is a particularily dangerous command, because it will make the branch you're currently on a copy of the branch in the argument, overwriting any commits you may have had (I've trashed my feature branch in this way at least once, this is why I always checkout the branch I'm going to run the command on, even if I'm already there).p However, in this case "git reset --hard origin/master" does what you want: make master a priestine copy of what's currently on savannah.