{"thread":{"id":"36755","subject":"Can we stage all files using \"git add\" command, except some specific files ?","startedAt":"2014-05-26T18:03:08Z","lastAt":"2014-05-27T03:04:08Z","messageCount":7,"participants":["Arup Rakshit","Dennis Kaarsemaker","Javier Domingo Cansino","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"242694","messageId":"8392138.j8Dle5WGbS@linux-wzza.site","threadId":"36755","inReplyTo":null,"subject":"Can we stage all files using \"git add\" command, except some specific files ?","fromName":"Arup Rakshit","fromEmail":"aruprakshit@rocketmail.com","sentAt":"2014-05-26T18:03:08Z","receivedAt":"2014-05-26T18:03:08Z","isPatch":false,"sender":{"key":"aruprakshit@rocketmail.com","avatar":"https://gravatar.com/avatar/a05a6142b0941fafb88c96b156982deb8e49e863ae7803d15c5147276fdeff92?d=mp&s=160"},"body":"Hi,\n\nLook below :\n\narup@linux-wzza:~/Rails/app> git status\n# On branch master\n#\n# Initial commit\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       .gitignore\n#       Gemfile\n#       Gemfile.lock\n#       README.rdoc\n#       Rakefile\n#       app/\n#       bin/\n#       config.ru\n#       config/\n#       db/\n#       lib/\n#       log/\n#       public/\n#       test/\n#       vendor/\narup@linux-wzza:~/Rails/app> git add -A\narup@linux-wzza:~/Rails/app> git status\n# On branch master\n#\n# Initial commit\n#\n# Changes to be committed:\n#   (use \"git rm --cached <file>...\" to unstage)\n#\n#       new file:   .gitignore\n#       new file:   Gemfile\n#       new file:   Gemfile.lock\n#       new file:   README.rdoc\n#       new file:   Rakefile\n#       new file:   app/assets/images/.keep\n#       new file:   app/assets/javascripts/application.js\n#       new file:   app/assets/javascripts/upload.js.coffee\n#       new file:   app/assets/stylesheets/application.css\n#       new file:   app/assets/stylesheets/upload.css.scss\n#       new file:   app/controllers/application_controller.rb\n#       new file:   app/controllers/concerns/.keep\n#       new file:   app/controllers/upload_controller.rb\n#       new file:   app/helpers/application_helper.rb\n#       new file:   app/helpers/upload_helper.rb\n#       new file:   app/mailers/.keep\n#       new file:   app/models/.keep\n#       new file:   app/models/concerns/.keep\n#       new file:   app/models/picture.rb\n#       new file:   app/views/layouts/application.html.erb\n#       new file:   app/views/upload/get.html.erb\n#       new file:   app/views/upload/show.html.erb\n#       new file:   bin/bundle\n#       new file:   bin/rails\n#       new file:   bin/rake\n#       new file:   bin/spring\n#       new file:   config.ru\n#       new file:   config/application.rb\n#.......................\n#...........................\narup@linux-wzza:~/Rails/app> git rm --cached .gitignore\nrm '.gitignore'\narup@linux-wzza:~/Rails/app> git rm --cached bin/bundle\nrm 'bin/bundle'\n\n\nNow, you can see, I have staged all the files first using *git add -A*, then \n_unstaging_ those I don't want to _stage_ right now. Now can this be done, in \nthe *staging* time ? I mean any way to tell `git add` command, that add all \nthe files from the current directory, except some specific files. What I want \nthis is, some times I have at least 30 files, whereas I want to _stage_ say, 20 \nfiles, not the rest 10. During _staging_ can I tell *git add* the same. I used \n*git add -h*, which didn't show me any such hints about my need.\n\n\n-- \n===============\nRegards,\nArup Rakshit\n"},{"id":"242697","messageId":"11486854.4deTbW34tQ@linux-wzza.site","threadId":"36755","inReplyTo":"1401135802.25483.1.camel@spirit","subject":"Re: Can we stage all files using \"git add\" command, except some specific files ?","fromName":"Arup Rakshit","fromEmail":"aruprakshit@rocketmail.com","sentAt":"2014-05-26T19:27:11Z","receivedAt":"2014-05-26T19:27:11Z","isPatch":false,"sender":{"key":"aruprakshit@rocketmail.com","avatar":"https://gravatar.com/avatar/a05a6142b0941fafb88c96b156982deb8e49e863ae7803d15c5147276fdeff92?d=mp&s=160"},"body":"On Monday, May 26, 2014 10:23:22 PM you wrote:\n> On di, 2014-05-27 at 00:33 +0630, Arup Rakshit wrote:\n> > Now, you can see, I have staged all the files first using *git add\n> > -A*, then _unstaging_ those I don't want to _stage_ right now. Now can\n> > this be done, in the *staging* time ? I mean any way to tell `git add`\n> > command, that add all the files from the current directory, except\n> > some specific files.\n> \n> No, there is no such option to do that, but you could use git add\n> --interactive and use its interface to quickly pick the files you want\n> to add.\n\nHi,\n\nI tried it also.. But just didn't get it, how to use,, lots of options 1,2,3 \netc .. :)\n\n-- \n===============\nRegards,\nArup Rakshit\n"},{"id":"242696","messageId":"1401135802.25483.1.camel@spirit","threadId":"36755","inReplyTo":"8392138.j8Dle5WGbS@linux-wzza.site","subject":"Re: Can we stage all files using \"git add\" command, except some specific files ?","fromName":"Dennis Kaarsemaker","fromEmail":"dennis@kaarsemaker.net","sentAt":"2014-05-26T20:23:22Z","receivedAt":"2014-05-26T20:23:22Z","isPatch":false,"sender":{"key":"dennis@kaarsemaker.net","avatar":"https://avatars.githubusercontent.com/u/200649?v=4"},"body":"On di, 2014-05-27 at 00:33 +0630, Arup Rakshit wrote:\n> \n> Now, you can see, I have staged all the files first using *git add\n> -A*, then _unstaging_ those I don't want to _stage_ right now. Now can\n> this be done, in the *staging* time ? I mean any way to tell `git add`\n> command, that add all the files from the current directory, except\n> some specific files.\n\nNo, there is no such option to do that, but you could use git add\n--interactive and use its interface to quickly pick the files you want\nto add.\n\n-- \nDennis Kaarsemaker\nwww.kaarsemaker.net\n"},{"id":"242701","messageId":"CALZVapnUgEnw6rv630awF7AjnfhRzzK8H5wP6jTLN6XZGVJDEQ@mail.gmail.com","threadId":"36755","inReplyTo":"11486854.4deTbW34tQ@linux-wzza.site","subject":"Re: Can we stage all files using \"git add\" command, except some specific files ?","fromName":"Javier Domingo Cansino","fromEmail":"javierdo1@gmail.com","sentAt":"2014-05-26T22:06:34Z","receivedAt":"2014-05-26T22:06:34Z","isPatch":false,"sender":{"key":"javierdo1@gmail.com","avatar":"https://gravatar.com/avatar/0f43d4d2e5f4320e8b5e1a46914213c5459dd0de261ab1587f222827f863d727?d=mp&s=160"},"body":"If you don't want an specific file, but you neither the .gitignore,\njust use .git/info/exclude file for project specific or\n$HOME/.config/git/ignore for user level.\n\nAnyway, this is all in man gitignore\n\n[1] Git ignore man page: http://git-scm.com/docs/gitignore\nJavier Domingo Cansino\n\n\n2014-05-26 21:27 GMT+02:00 Arup Rakshit <aruprakshit@rocketmail.com>:\n> On Monday, May 26, 2014 10:23:22 PM you wrote:\n>> On di, 2014-05-27 at 00:33 +0630, Arup Rakshit wrote:\n>> > Now, you can see, I have staged all the files first using *git add\n>> > -A*, then _unstaging_ those I don't want to _stage_ right now. Now can\n>> > this be done, in the *staging* time ? I mean any way to tell `git add`\n>> > command, that add all the files from the current directory, except\n>> > some specific files.\n>>\n>> No, there is no such option to do that, but you could use git add\n>> --interactive and use its interface to quickly pick the files you want\n>> to add.\n>\n> Hi,\n>\n> I tried it also.. But just didn't get it, how to use,, lots of options 1,2,3\n> etc .. :)\n>\n> --\n> ===============\n> Regards,\n> Arup Rakshit\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"242705","messageId":"CACsJy8DNLyyMoxVK0TN9YFQVHVzOMVi7vccKAYb8mdA_jpmkZQ@mail.gmail.com","threadId":"36755","inReplyTo":"8392138.j8Dle5WGbS@linux-wzza.site","subject":"Re: Can we stage all files using \"git add\" command, except some specific files ?","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-05-26T22:19:05Z","receivedAt":"2014-05-26T22:19:05Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, May 27, 2014 at 1:03 AM, Arup Rakshit\n<aruprakshit@rocketmail.com> wrote:\n> Now, you can see, I have staged all the files first using *git add -A*, then\n> _unstaging_ those I don't want to _stage_ right now. Now can this be done, in\n> the *staging* time ? I mean any way to tell `git add` command, that add all\n> the files from the current directory, except some specific files. What I want\n> this is, some times I have at least 30 files, whereas I want to _stage_ say, 20\n> files, not the rest 10. During _staging_ can I tell *git add* the same. I used\n> *git add -h*, which didn't show me any such hints about my need.\n\n\nTry \"git add -A :/ :!<pattern1> :!<pattern2>\" which basically says add\nall files in repo _except_ those that match pattern1, or pattern2... I\nassume you can classify \"the rest 10\" because there's no way to\nexpress \"Adding all except the rest 10\".\n-- \nDuy\n"},{"id":"242707","messageId":"CACsJy8B7TeeT-xOoZyPc6_LLEL-ugdgzbKf3FYci28f9eGrpvA@mail.gmail.com","threadId":"36755","inReplyTo":"CALZVapnUgEnw6rv630awF7AjnfhRzzK8H5wP6jTLN6XZGVJDEQ@mail.gmail.com","subject":"Re: Can we stage all files using \"git add\" command, except some specific files ?","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-05-26T22:24:56Z","receivedAt":"2014-05-26T22:24:56Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, May 27, 2014 at 5:06 AM, Javier Domingo Cansino\n<javierdo1@gmail.com> wrote:\n> If you don't want an specific file, but you neither the .gitignore,\n> just use .git/info/exclude file for project specific or\n> $HOME/.config/git/ignore for user level.\n\nThis is actually better. 'git add' does not allow to specify exclude\npatterns in command line (more convenient then editing .gitignore)\nlike ls-files. Perhaps we should add it for one-shot exclusion?\n\n> Anyway, this is all in man gitignore\n>\n> [1] Git ignore man page: http://git-scm.com/docs/gitignore\n> Javier Domingo Cansino\n-- \nDuy\n"},{"id":"242717","messageId":"5153533.2ydIqZPOTZ@linux-wzza.site","threadId":"36755","inReplyTo":"CALZVapnUgEnw6rv630awF7AjnfhRzzK8H5wP6jTLN6XZGVJDEQ@mail.gmail.com","subject":"Re: Can we stage all files using \"git add\" command, except some specific files ?","fromName":"Arup Rakshit","fromEmail":"aruprakshit@rocketmail.com","sentAt":"2014-05-27T03:04:08Z","receivedAt":"2014-05-27T03:04:08Z","isPatch":false,"sender":{"key":"aruprakshit@rocketmail.com","avatar":"https://gravatar.com/avatar/a05a6142b0941fafb88c96b156982deb8e49e863ae7803d15c5147276fdeff92?d=mp&s=160"},"body":"On Tuesday, May 27, 2014 12:06:34 AM you wrote:\n> If you don't want an specific file, but you neither the .gitignore,\n> just use .git/info/exclude file for project specific or\n> $HOME/.config/git/ignore for user level.\n> \n> Anyway, this is all in man gitignore\n> \n> [1] Git ignore man page: http://git-scm.com/docs/gitignore\n> Javier Domingo Cansino\n\nHum. That I know, but I show that in my post, just as an example. Here \nquestion was other files, not _.gitignore_. Anyway, I understand now, that I am \nlooking for is not available in Git. The way, I was doing, is the only way to \ndo it.\n\nThanks for your reply.\n\n-- \n===============\nRegards,\nArup Rakshit\n"}]}