From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harald Hanche-Olsen Newsgroups: gmane.emacs.devel Subject: Re: VC mode and git Date: Wed, 25 Mar 2015 19:04:55 +0100 Message-ID: <5512F8C7.7010509@math.ntnu.no> References: <5511998E.8080309@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1427306748 11267 80.91.229.3 (25 Mar 2015 18:05:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2015 18:05:48 +0000 (UTC) Cc: Paul Eggert , emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 25 19:05:43 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 1YapgR-0002c9-KR for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 19:05:39 +0100 Original-Received: from localhost ([::1]:40620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YapgR-00062G-1N for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2015 14:05:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yapg1-0005s4-FV for emacs-devel@gnu.org; Wed, 25 Mar 2015 14:05:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yapfx-0006Im-3J for emacs-devel@gnu.org; Wed, 25 Mar 2015 14:05:13 -0400 Original-Received: from hylle05.itea.ntnu.no ([129.241.56.225]:40855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yapfw-000620-T9; Wed, 25 Mar 2015 14:05:09 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by hylle05.itea.ntnu.no (Postfix) with ESMTP id C9EFF90CBC0; Wed, 25 Mar 2015 19:04:58 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at hylle05.itea.ntnu.no Original-Received: from [IPv6:2001:700:300:1470:d0f9:9872:311c:333b] (unknown [IPv6:2001:700:300:1470:d0f9:9872:311c:333b]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: hanche) by hylle05.itea.ntnu.no (Postfix) with ESMTPSA id 41C5790CB62; Wed, 25 Mar 2015 19:04:57 +0100 (CET) User-Agent: Postbox 3.0.11 (Macintosh/20140602) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 129.241.56.225 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:184246 Archived-At: Richard Stallman wrote: > > As a separate matter, something is wrong in my repository with > lisp/ChangeLog. I have changes I want to check in, and I don't know > what to do. Brief hints are not enough to enable me to fix this. > How should I get my changes installed? > > Would you please help me? Why did you not take my advice on that other thread to post the output=20 of =E2=80=9Cgit status -s=E2=80=9D to the list? I bet there are many peop= le able to=20 help, but giving step by step advice based on too little information is=20 dangerous and could lead you into further trouble. Here is a sample output from =E2=80=9Cgit status -s=E2=80=9D, after I mad= e some=20 frivolous changes: ; git s ## master...origin/master MM ChangeLog M README M lisp/mail/rmail.el Here, README is changed and staged for commit (it's in the index),=20 lisp/mail/rmail.el is changed but not staged for commit, and Changelog=20 is changed and staged for commit, then changed again and the new change=20 is not staged for commit. (Staging for commit is typically done by =E2=80= =9Cgit=20 add=E2=80=9D.) It is also useful to know if you have any local commits. Assuming you=20 are on the master branch, you can run git log origin/master..master If it produces no output, then you have no local commits that are not in=20 the remote branch. If you do, more work is required to recover. It is POSSIBLE that a safe way to recover from your problems is as follow= s: git stash git reset --hard HEAD git pull --ff-only git stash apply but I don't want to be the guy who goes down in history as the one who=20 caused you to lose your changes because you followed this advice. Maybe, if someone with more git experience reads this and says it is=20 good, you should go ahead. Of course, if any of the commands but the=20 last fails, stop and ask for advice again. If the last one reports merge=20 conflicts, fix them by hand and run =E2=80=9Cgit add=E2=80=9D on each fil= e after you=20 fixed it. DO NOT use C-x v v after fixing a merge conflict, since that=20 runs both git add and git commit, and you are not ready for the latter=20 until all merge conflicts are dealt with. In any case, do run git status before finally doing git commit. If all=20 succeeds, you can clean up with git stash drop =E2=80=93 Harald