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

Re: Basic Git Questions

From
GSGeorge Spelvin <linux@horizon.com>
Date
Dec 20, 2010, 19:21 UTC
Message-ID
<20101220192152.4509.qmail@science.horizon.com>
> 1. I generally add the files in my working directory using "git add
> .". But sometimes you want to add all the files except 1 or 2 file. Is
> there a shortcut way we can tell git to add all the files but exclude
> a particular file.

Others have pointed out the general techniques, but a few additional things that may be useful in some situations:

1) .gitignore.  If the files are such that you never want git to pay
   attention to them, you can add them to the .gitignore file.
2) "git add -u".  This adds only files that git is already tracking,
   and ignores truly new files.
3) "git add -i".  This lets you pick the files to be added from a list.
4) "git gui".  This lets you click on the files to be added.
   It's my preferred way to do a selective commit.
Next: Adam Kellas
Message 1 of 2 in “Re: Basic Git Questions”
  1. George SpelvinDec 20, 2010
  2. Adam KellasDec 21, 2010

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.