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