* Can we stage all files using "git add" command, except some specific files ?
@ 2014-05-26 18:03 Arup Rakshit
2014-05-26 20:23 ` Dennis Kaarsemaker
2014-05-26 22:19 ` Duy Nguyen
0 siblings, 2 replies; 7+ messages in thread
From: Arup Rakshit @ 2014-05-26 18:03 UTC (permalink / raw)
To: git
Hi,
Look below :
arup@linux-wzza:~/Rails/app> git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .gitignore
# Gemfile
# Gemfile.lock
# README.rdoc
# Rakefile
# app/
# bin/
# config.ru
# config/
# db/
# lib/
# log/
# public/
# test/
# vendor/
arup@linux-wzza:~/Rails/app> git add -A
arup@linux-wzza:~/Rails/app> git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: .gitignore
# new file: Gemfile
# new file: Gemfile.lock
# new file: README.rdoc
# new file: Rakefile
# new file: app/assets/images/.keep
# new file: app/assets/javascripts/application.js
# new file: app/assets/javascripts/upload.js.coffee
# new file: app/assets/stylesheets/application.css
# new file: app/assets/stylesheets/upload.css.scss
# new file: app/controllers/application_controller.rb
# new file: app/controllers/concerns/.keep
# new file: app/controllers/upload_controller.rb
# new file: app/helpers/application_helper.rb
# new file: app/helpers/upload_helper.rb
# new file: app/mailers/.keep
# new file: app/models/.keep
# new file: app/models/concerns/.keep
# new file: app/models/picture.rb
# new file: app/views/layouts/application.html.erb
# new file: app/views/upload/get.html.erb
# new file: app/views/upload/show.html.erb
# new file: bin/bundle
# new file: bin/rails
# new file: bin/rake
# new file: bin/spring
# new file: config.ru
# new file: config/application.rb
#.......................
#...........................
arup@linux-wzza:~/Rails/app> git rm --cached .gitignore
rm '.gitignore'
arup@linux-wzza:~/Rails/app> git rm --cached bin/bundle
rm 'bin/bundle'
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.
--
===============
Regards,
Arup Rakshit
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we stage all files using "git add" command, except some specific files ?
2014-05-26 20:23 ` Dennis Kaarsemaker
@ 2014-05-26 19:27 ` Arup Rakshit
2014-05-26 22:06 ` Javier Domingo Cansino
0 siblings, 1 reply; 7+ messages in thread
From: Arup Rakshit @ 2014-05-26 19:27 UTC (permalink / raw)
To: git
On Monday, May 26, 2014 10:23:22 PM you wrote:
> On di, 2014-05-27 at 00:33 +0630, Arup Rakshit wrote:
> > 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.
>
> No, there is no such option to do that, but you could use git add
> --interactive and use its interface to quickly pick the files you want
> to add.
Hi,
I tried it also.. But just didn't get it, how to use,, lots of options 1,2,3
etc .. :)
--
===============
Regards,
Arup Rakshit
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we stage all files using "git add" command, except some specific files ?
2014-05-26 18:03 Can we stage all files using "git add" command, except some specific files ? Arup Rakshit
@ 2014-05-26 20:23 ` Dennis Kaarsemaker
2014-05-26 19:27 ` Arup Rakshit
2014-05-26 22:19 ` Duy Nguyen
1 sibling, 1 reply; 7+ messages in thread
From: Dennis Kaarsemaker @ 2014-05-26 20:23 UTC (permalink / raw)
To: Arup Rakshit; +Cc: git
On di, 2014-05-27 at 00:33 +0630, Arup Rakshit wrote:
>
> 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.
No, there is no such option to do that, but you could use git add
--interactive and use its interface to quickly pick the files you want
to add.
--
Dennis Kaarsemaker
www.kaarsemaker.net
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we stage all files using "git add" command, except some specific files ?
2014-05-26 19:27 ` Arup Rakshit
@ 2014-05-26 22:06 ` Javier Domingo Cansino
2014-05-26 22:24 ` Duy Nguyen
2014-05-27 3:04 ` Arup Rakshit
0 siblings, 2 replies; 7+ messages in thread
From: Javier Domingo Cansino @ 2014-05-26 22:06 UTC (permalink / raw)
To: Arup Rakshit; +Cc: git@vger.kernel.org
If you don't want an specific file, but you neither the .gitignore,
just use .git/info/exclude file for project specific or
$HOME/.config/git/ignore for user level.
Anyway, this is all in man gitignore
[1] Git ignore man page: http://git-scm.com/docs/gitignore
Javier Domingo Cansino
2014-05-26 21:27 GMT+02:00 Arup Rakshit <aruprakshit@rocketmail.com>:
> On Monday, May 26, 2014 10:23:22 PM you wrote:
>> On di, 2014-05-27 at 00:33 +0630, Arup Rakshit wrote:
>> > 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.
>>
>> No, there is no such option to do that, but you could use git add
>> --interactive and use its interface to quickly pick the files you want
>> to add.
>
> Hi,
>
> I tried it also.. But just didn't get it, how to use,, lots of options 1,2,3
> etc .. :)
>
> --
> ===============
> Regards,
> Arup Rakshit
> --
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we stage all files using "git add" command, except some specific files ?
2014-05-26 18:03 Can we stage all files using "git add" command, except some specific files ? Arup Rakshit
2014-05-26 20:23 ` Dennis Kaarsemaker
@ 2014-05-26 22:19 ` Duy Nguyen
1 sibling, 0 replies; 7+ messages in thread
From: Duy Nguyen @ 2014-05-26 22:19 UTC (permalink / raw)
To: Arup Rakshit; +Cc: Git Mailing List
On Tue, May 27, 2014 at 1:03 AM, Arup Rakshit
<aruprakshit@rocketmail.com> wrote:
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we stage all files using "git add" command, except some specific files ?
2014-05-26 22:06 ` Javier Domingo Cansino
@ 2014-05-26 22:24 ` Duy Nguyen
2014-05-27 3:04 ` Arup Rakshit
1 sibling, 0 replies; 7+ messages in thread
From: Duy Nguyen @ 2014-05-26 22:24 UTC (permalink / raw)
To: Javier Domingo Cansino; +Cc: Arup Rakshit, git@vger.kernel.org
On Tue, May 27, 2014 at 5:06 AM, Javier Domingo Cansino
<javierdo1@gmail.com> wrote:
> If you don't want an specific file, but you neither the .gitignore,
> just use .git/info/exclude file for project specific or
> $HOME/.config/git/ignore for user level.
This is actually better. 'git add' does not allow to specify exclude
patterns in command line (more convenient then editing .gitignore)
like ls-files. Perhaps we should add it for one-shot exclusion?
> Anyway, this is all in man gitignore
>
> [1] Git ignore man page: http://git-scm.com/docs/gitignore
> Javier Domingo Cansino
--
Duy
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Can we stage all files using "git add" command, except some specific files ?
2014-05-26 22:06 ` Javier Domingo Cansino
2014-05-26 22:24 ` Duy Nguyen
@ 2014-05-27 3:04 ` Arup Rakshit
1 sibling, 0 replies; 7+ messages in thread
From: Arup Rakshit @ 2014-05-27 3:04 UTC (permalink / raw)
To: git
On Tuesday, May 27, 2014 12:06:34 AM you wrote:
> If you don't want an specific file, but you neither the .gitignore,
> just use .git/info/exclude file for project specific or
> $HOME/.config/git/ignore for user level.
>
> Anyway, this is all in man gitignore
>
> [1] Git ignore man page: http://git-scm.com/docs/gitignore
> Javier Domingo Cansino
Hum. That I know, but I show that in my post, just as an example. Here
question was other files, not _.gitignore_. Anyway, I understand now, that I am
looking for is not available in Git. The way, I was doing, is the only way to
do it.
Thanks for your reply.
--
===============
Regards,
Arup Rakshit
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-05-27 4:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-26 18:03 Can we stage all files using "git add" command, except some specific files ? Arup Rakshit
2014-05-26 20:23 ` Dennis Kaarsemaker
2014-05-26 19:27 ` Arup Rakshit
2014-05-26 22:06 ` Javier Domingo Cansino
2014-05-26 22:24 ` Duy Nguyen
2014-05-27 3:04 ` Arup Rakshit
2014-05-26 22:19 ` Duy Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).