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

Re: Can we stage all files using "git add" command, except some specific files ?

From
Duy Nguyen <pclouds@gmail.com>
Date
May 26, 2014, 22:19 UTC
Message-ID
<CACsJy8DNLyyMoxVK0TN9YFQVHVzOMVi7vccKAYb8mdA_jpmkZQ@mail.gmail.com>
In-Reply-To
<8392138.j8Dle5WGbS@linux-wzza.site>

On Tue, May 27, 2014 at 1:03 AM, Arup Rakshit <aruprakshit@rocketmail.com> wrote:

Show 7 quoted lines
> Now, you can see, I have staged all the files first using *git add -A*, then
> _unstaging_ those I don't want to _stage_ right now. Now can this be done, in
> the *staging* time ? I mean any way to tell `git add` command, that add all
> the files from the current directory, except some specific files. What I want
> this is, some times I have at least 30 files, whereas I want to _stage_ say, 20
> files, not the rest 10. During _staging_ can I tell *git add* the same. I used
> *git add -h*, which didn't show me any such hints about my need.

Try "git add -A :/ :!<pattern1> :!<pattern2>" which basically says add all files in repo _except_ those that match pattern1, or pattern2... I assume you can classify "the rest 10" because there's no way to express "Adding all except the rest 10".

-- 
Duy
Previous: Arup Rakshit
Message 7 of 7 in “Can we stage all files using "git add" command, except some specific files ?”
  1. Arup RakshitMay 26, 2014
  2. Dennis KaarsemakerMay 26, 2014
  3. Arup RakshitMay 26, 2014
  4. Javier Domingo CansinoMay 26, 2014
  5. Duy NguyenMay 26, 2014
  6. Arup RakshitMay 27, 2014
  7. Duy NguyenMay 26, 2014

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.