From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kelvin White Newsgroups: gmane.emacs.devel Subject: Re: After a git merge and manual correction of a conflict, how do I tell git the conflict is fixed? Date: Wed, 27 May 2015 03:16:39 +0000 Message-ID: References: <20150526223928.GA4675@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1133e3f6e7c462051707ab1a X-Trace: ger.gmane.org 1432696630 26573 80.91.229.3 (27 May 2015 03:17:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 May 2015 03:17:10 +0000 (UTC) Cc: Alan Mackenzie , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 27 05:17:03 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 1YxRq0-0005vG-4p for ged-emacs-devel@m.gmane.org; Wed, 27 May 2015 05:17:00 +0200 Original-Received: from localhost ([::1]:51650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxRpz-0002C1-6f for ged-emacs-devel@m.gmane.org; Tue, 26 May 2015 23:16:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxRpj-0002Bu-Od for emacs-devel@gnu.org; Tue, 26 May 2015 23:16:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxRpg-0006U9-HH for emacs-devel@gnu.org; Tue, 26 May 2015 23:16:43 -0400 Original-Received: from mail-qk0-f170.google.com ([209.85.220.170]:34360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxRpg-0006Tx-Bl for emacs-devel@gnu.org; Tue, 26 May 2015 23:16:40 -0400 Original-Received: by qkgx75 with SMTP id x75so105158156qkg.1 for ; Tue, 26 May 2015 20:16:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=Gpcyj4kK7jPA2ZnLuBluJZGVd4t4XmV4eRshss3FZM0=; b=HblZ3qZ3KC0Zcw9fNwF87RvtWTj5WFC+3+TtHrb+apej9u7HpJMY+m1/dbN372oGnQ mgPKJLDk+0w2o9Rbc8W0m4Jw/v4c5BUH/xcIyULFVVf79BBCrYp6JSu0CYNPKlO1ZnGk 8yYMUsh8PcxPjO4KkZ1levZMc+0TespA4figazKJpCc3voFFAlaQXRAn34oZQu2Fc4Tb SksKoFqiVkemPi/kh/r+iJsQXAUPWRdDJyol/oZGkK21IM11Xt14iyMF5aMHIWR7Ci5x +/np3DFeKJ3aJJhOnyAxgyuwLs/mtz79woLc+UoeLLKpl+snBk5APQhIx2Ob1sWreJZr esAQ== X-Received: by 10.229.16.69 with SMTP id n5mr39497709qca.25.1432696599854; Tue, 26 May 2015 20:16:39 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.170 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:186859 Archived-At: --001a1133e3f6e7c462051707ab1a Content-Type: text/plain; charset=UTF-8 On Tue, May 26, 2015 at 11:14 PM Kelvin White wrote: > On Tue, May 26, 2015 at 10:55 PM Kelvin White wrote: > >> On Tue, May 26, 2015 at 10:40 PM Stefan Monnier >> wrote: >> >>> > Which will have the exact same effects as `git rm --cached ' no? >>> >>> Not at all. "git rm ..." will remove the file from the repository, >>> i.e. it will have an effect for *everyone else*. >>> >>> >>> Stefan >>> >>> >> Forgive me, but I think the confusion here is due to the fact that `git >> reset ' will remove it from the curennt index, while `git rm --cache >> ' will remove it from the repository completely, while leaving the >> current local copy in tact. >> > > In this case, this is exactly what you would want. Why would you want to > keep this file in version control for everyone else? Consider this... > > l3thal@dev ~/src/emacs-dev $ git checkout -b test > Switched to a new branch 'test' > l3thal@dev ~/src/emacs-dev $ echo "moo" >> test_file > l3thal@dev ~/src/emacs-dev $ git status > # On branch test > # Untracked files: > # (use "git add ..." to include in what will be committed) > # > # test_file > nothing added to commit but untracked files present (use "git add" to > track) > l3thal@dev ~/src/emacs-dev $ git add test_file > l3thal@dev ~/src/emacs-dev $ git status > # On branch test > # Changes to be committed: > # (use "git reset HEAD ..." to unstage) > # > # new file: test_file > # > l3thal@dev ~/src/emacs-dev $ git commit -m "adding test file" > [test dde69ae] adding test file > 1 file changed, 2 insertions(+) > create mode 100644 test_file > l3thal@dev ~/src/emacs-dev $ git status > # On branch test > nothing to commit, working directory clean > l3thal@dev ~/src/emacs-dev $ git rm --cached test_file > rm 'test_file' > l3thal@dev ~/src/emacs-dev $ git status > # On branch test > # Changes to be committed: > # (use "git reset HEAD ..." to unstage) > # > # deleted: test_file > # > # Untracked files: > # (use "git add ..." to include in what will be committed) > # > # test_file > l3thal@dev ~/src/emacs-dev $ git commit -am "removing test file" > [test 46f7f53] removing test file > 1 file changed, 2 deletions(-) > delete mode 100644 test_file > l3thal@dev ~/src/emacs-dev $ git status > # On branch test > # Untracked files: > # (use "git add ..." to include in what will be committed) > # > # test_file > nothing added to commit but untracked files present (use "git add" to > track) > This is the same situation as a merge conflict in a file that you dont want to keep in the remote git repo.. You need to remove it from the index and keep it locally. --001a1133e3f6e7c462051707ab1a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Tue, May 26, 2015 at= 11:14 PM Kelvin White <kwhite@gnu.org= > wrote:
On Tue, May 26, 2015 at 10:55 PM Kelvin White <kwhite@gnu.org> wrote:=
On Tue, May 26, 2015 at 10:40 PM Stefan Monnier <monnier@iro.umontreal.ca>= wrote:
>=C2=A0 Which will have the ex= act same effects as `git rm --cached <file>' no?

Not at all.=C2=A0 "git rm ..." will remove the file from the repo= sitory,
i.e. it will have an effect for *everyone else*.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan


Forgive me, but I think the confusion here is due to the = fact that `git reset <file>' will remove it from the curennt inde= x, while `git rm --cache <file>' will remove it from the reposito= ry completely, while leaving the current local copy in tact.

In this case, this is exactly what you would want. Why wou= ld you want to keep this file in version control for everyone else? Conside= r this...

l3thal@dev ~/src/emacs-dev $ git ch= eckout -b test
Switched to a new branch 'test'
= l3thal@dev ~/src/emacs-dev $ echo "moo" >> test_file
<= div>l3thal@dev ~/src/emacs-dev $ git status
# On branch test
# Untracked files:
# =C2=A0 (use "git add <file>= ..." to include in what will be committed)
#
# test_file
nothing added = to commit but untracked files present (use "git add" to track)
l3thal@dev ~/src/emacs-dev $ git add test_file
l3thal@dev= ~/src/emacs-dev $ git status
# On branch test
# Change= s to be committed:
# =C2=A0 (use "git reset HEAD <file>= ;..." to unstage)
#
# new file: =C2=A0 test_file
#
l3thal@dev= ~/src/emacs-dev $ git commit -m "adding test file"
[te= st dde69ae] adding test file
=C2=A01 file changed, 2 insertions(+= )
=C2=A0create mode 100644 test_file
l3thal@dev ~/src/e= macs-dev $ git status
# On branch test
nothing to commi= t, working directory clean
l3thal@dev ~/src/emacs-dev $ git rm --= cached test_file
rm 'test_file'
l3thal@dev ~/sr= c/emacs-dev $ git status
# On branch test
# Changes to = be committed:
# =C2=A0 (use "git reset HEAD <file>...&= quot; to unstage)
#
# deleted: =C2=A0 =C2=A0test_file
#
# Untracke= d files:
# =C2=A0 (use "git add <file>..." to inc= lude in what will be committed)
#
# test_file
l3thal@dev ~/src/emacs-dev $ g= it commit -am "removing test file"
[test 46f7f53] remov= ing test file
=C2=A01 file changed, 2 deletions(-)
=C2= =A0delete mode 100644 test_file
l3thal@dev ~/src/emacs-dev $ git = status
# On branch test
# Untracked files:
# = =C2=A0 (use "git add <file>..." to include in what will be = committed)
#
# tes= t_file
nothing added to commit but untracked files present= (use "git add" to track)

This is the same situation as a merge conflict in= a file that you dont want to keep in the remote git repo.. You need to rem= ove it from the index and keep it locally.=C2=A0
--001a1133e3f6e7c462051707ab1a--