git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Kevin Daudt <me@ikke.info>
To: Timur Tabi <timur@codeaurora.org>
Cc: git <git@vger.kernel.org>
Subject: Re: .gitignore does not ignore Makefile
Date: Thu, 22 Sep 2016 17:44:21 +0200	[thread overview]
Message-ID: <20160922154421.GA6641@ikke.info> (raw)
In-Reply-To: <CAOZdJXWpcSZ+jAoV8HttkaB7Fh=wzWDTCsHy8W-S9xOOBodVFw@mail.gmail.com>

On Thu, Sep 22, 2016 at 09:19:22AM -0500, Timur Tabi wrote:
> I have the following .gitignore file in patch arm/arm64/boot/dts:
> 
> *.dtb
> qcom
> qcom.orig
> 
> When I do a git status, I see this:
> 
>     modified:   .gitignore
>     modified:   qcom/Makefile
> 
> All of the other files in arm/arm64/boot/dts/qcom are being ignored,
> as request.  However, the file "Makefile" is not being ignored.  Why?
> What's so special about "Makefile" that git refuses to ignore it?
> 

There is nothing special about the Makefile, except that it's tracked.
Git never ignores tracked files (almost a paradox).

You can untrack the file by doing git rm --cached <file>, which new
commits won't have this file.

If your goal is to ignore local changes to a tracked file, then the
advise is to reconsider your plan. 

Often people advise tricks like `git update-index --assume-unchanges
<file>`, but this does not work as expected. It's merely a promise to
git that this file does not change (and hence, git will not check if
this file has changed when doing git status), but command that try to
change this file will abort saying that the file has changed.

Hope this helps,

Kevin.


  reply	other threads:[~2016-09-22 15:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 14:19 .gitignore does not ignore Makefile Timur Tabi
2016-09-22 15:44 ` Kevin Daudt [this message]
2016-09-22 18:26   ` Junio C Hamano
2016-09-22 18:44     ` Timur Tabi
2016-09-22 19:16       ` Junio C Hamano
2016-09-23 22:29     ` Jakub Narębski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160922154421.GA6641@ikke.info \
    --to=me@ikke.info \
    --cc=git@vger.kernel.org \
    --cc=timur@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).