From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: git pull fails with merge conflicts. How can this possibly happen? Date: Sat, 15 Nov 2014 12:41:12 +0700 Message-ID: References: <20141114183737.GB3168@acm.acm> <5466517B.50705@porkrind.org> <20141114215404.GD3168@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1416030097 20348 80.91.229.3 (15 Nov 2014 05:41:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 15 Nov 2014 05:41:37 +0000 (UTC) Cc: Emacs developers , David Caldwell To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 15 06:41:28 2014 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 1XpW6x-0000qw-UH for ged-emacs-devel@m.gmane.org; Sat, 15 Nov 2014 06:41:28 +0100 Original-Received: from localhost ([::1]:38762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpW6x-0007Ow-H0 for ged-emacs-devel@m.gmane.org; Sat, 15 Nov 2014 00:41:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpW6l-0007Or-AU for emacs-devel@gnu.org; Sat, 15 Nov 2014 00:41:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XpW6k-0001ru-5C for emacs-devel@gnu.org; Sat, 15 Nov 2014 00:41:15 -0500 Original-Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]:34654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XpW6j-0001qY-Ut for emacs-devel@gnu.org; Sat, 15 Nov 2014 00:41:14 -0500 Original-Received: by mail-ig0-f177.google.com with SMTP id uq10so1426819igb.16 for ; Fri, 14 Nov 2014 21:41:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=R9/adE1Mli/nnRrTnSgXPCzJUIJaV+/auXleC7rJUJw=; b=RvVib5bbQZQ5uzAsA3TIo5MEK+cvBumlcuRJP9LAlJnAM5fQjf7h60qJdLYIt++vJI EKYcfSZJAHi5d/cFbVKJmkHh1/qrtjXV+PQharloEAwB7mPqDVi7/loQyq3QQKvHfQ9/ hnwE6N+WIswmnk0wku/Gu4ZNhhSzRHxaCrvcFBDJh/6O6lFZ7gCmh6Hj9y9CeV9kwAe9 g7MqHPkwygk2ygR2/EBDc3uvgtcRcOSH5H2HFiM1Kzb7Bjz+yyGYq9LMchR89n3VxHct 4WxHU6FfhzHaKQp9B1ysYfBgvrt8x3u0dComeutTERcFEPT+sn8KZwpPLkDX2UN/vXjr CSCA== X-Received: by 10.50.79.232 with SMTP id m8mr11124387igx.11.1416030073044; Fri, 14 Nov 2014 21:41:13 -0800 (PST) Original-Received: by 10.107.48.3 with HTTP; Fri, 14 Nov 2014 21:41:12 -0800 (PST) In-Reply-To: <20141114215404.GD3168@acm.acm> X-Google-Sender-Auth: mfpoG4O3CXz-eKNrBI8LFKZRjyY X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::231 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:177137 Archived-At: On Sat, Nov 15, 2014 at 3:54 AM, Alan Mackenzie wrote: > gitk doesn't work on my system, of course. (Nothing ever does without a > lot of effort). I want to propose a couple of rules of thumb for beginner Git users. Rule First: * Drop everything else you=E2=80=99re trying to do with Git and get comfortable with at least one Git repository browser. One that displays pretty graphs. Starting with Git without a graph browser is like learning chess by playing blind. At a minimum, this command is always available: $ git log --graph --decorate --oneline --color =E2=80=A6 Rule Second: * Do not ever use =E2=80=9Cgit pull=E2=80=9D. =E2=80=9Cgit pull=E2=80=9D does two things. First, it will bring into your = local repository new commits[1] from the remote, and rearrange the remote tracking branch heads[2] to match their current positions in the remote. Second, it will try to match[3] your local branch head with a remote tracking branch head, and merge that into your local branch. [1] This set of commits is unpredictable and depends on the past actions of many other people. [2] The motion of remote tracking branches is unpredictable and depends on the past actions of many other people. [3] The matching of the local branch to the corresponding remote tracking branch is predictable and depends only on your own actions. But still it is often surprising. Instead: 1. Cautiously =E2=80=9Cgit fetch=E2=80=9D new remote state into your local = repo. 2. Explore the changes with a graph browser, at least for the few branches you are directly interested in (emacs-24 and master). See if any of the remote branches diverged with your local branches. 3. Decide if you want a merge, a rebase, a cherry-pick, or something else entirely. (I have seen cases when the remote had changed so much that it was easier to reimplement a feature on top of the new remote state than try to merge or rebase.) Also, required reading/watching: * Git Pro, book by Scott Chacon * Git For Ages 4 and Up, talk by Michael Schwern > Funny thing: looking at the gitk man page, there doesn't > appear to be a way of specifying the repository. Hmm. By convention, all git commands assume they are run within the repository. So just cd into the repo first. Some features in gitk also assume it has been run in the repository root. (Arguably this is a bug but apparently no one has yet gotten around to fix it.)