git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: gitignore design

From
Philip Oakley <philipoakley@iee.org>
Date
Jul 29, 2011, 16:44 UTC
Message-ID
<295478CF936A4310941CE2001892A2DA@PhilipOakley>
In-Reply-To
<1311934832699-6632987.post@n2.nabble.com>
The answer is that you can use
   git add --force <filename>
to force git to take a copy of the current version of that file and place it 
in the staging area, despite it being in the ignore list.
 Being *in* the staging area means that that specific version will be copied 
into each commit until you ask git to remove that copy (with git rm 
<filename> from the staging area, or update that copy, or whatever.

This depends on how (i.e. the options) you add files before a commit, or do the commit itself, etc. For example the 'git add -A .' option will notice all the changes, including any updates to your <filename> (which may not be what you want).

Git is flexible enough to do what you need. It can be hard to see the effect of all the options especially if someone has shown you a 'magic' command, but hasn't fully explained the consequences. Many things are only obvious in retrospect.

Philip Oakley
Scotland
----- Original Message ----- 
From: "llucianf" <llucianf@gmail.com>
To: <git@vger.kernel.org>
Sent: Friday, July 29, 2011 11:20 AM
Subject: gitignore design
Show 25 quoted lines
> why gitignore doesnt simply work like in cvs where if you put something in
> the ignore file, those stuff are simply ignored from that point without
> having to remove them from repo?
>
>
> --
> View this message in context: 
> http://git.661346.n2.nabble.com/gitignore-design-tp6632987p6632987.html
> Sent from the git mailing list archive at Nabble.com.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1390 / Virus Database: 1518/3793 - Release Date: 07/28/11
> 
Previous: Clemens Buchacher
Message 20 of 20 in “gitignore design”
  1. llucianfJul 29, 2011
  2. Ferry HubertsJul 29, 2011
  3. llucianfJul 29, 2011
  4. Ferry HubertsJul 29, 2011
  5. llucianfJul 29, 2011
  6. Jakub NarebskiJul 29, 2011
  7. llucianfJul 29, 2011
  8. Jakub NarebskiJul 29, 2011
  9. Ferry HubertsJul 29, 2011
  10. Jakub NarebskiJul 29, 2011
  11. Johannes SixtJul 29, 2011
  12. Jakub NarebskiJul 29, 2011
  13. Johannes SixtJul 29, 2011
  14. Jakub NarebskiJul 29, 2011
  15. Nguyen Thai Ngoc DuyJul 30, 2011
  16. Piotr KrukowieckiJul 30, 2011
  17. Nguyen Thai Ngoc DuyJul 30, 2011
  18. Piotr KrukowieckiJul 30, 2011
  19. Clemens BuchacherJul 30, 2011
  20. Philip OakleyJul 29, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.