Re: [git-users] .gitignore directory override adds modified files but not new files

2019-09-25 Thread Mick Killianey
There's a section at the bottom of the `gitignore` docs (see
https://git-scm.com/docs/gitignore) that deals specifically with this use
case.  It reads:

Example to exclude everything except a specific directory foo/bar (note the
/* - without the slash, the wildcard would also exclude everything within
foo/bar):

$ cat .gitignore
# exclude everything except directory foo/bar
/*
!/foo
/foo/*
!/foo/bar

(Note the use of the `/*` suffix.)


On Tue, Sep 24, 2019 at 3:35 AM Frank Millman  wrote:

> A section of my .gitignore looks like this
>
>
> aib/html/ !aib/html/src/
>
>
> The intention is to exclude the contents of aib/html/, but include the
> contents of aib/html/src/.
>
>
> git status correctly shows files in aib/html/src/ that have been modified,
> but does not show files that have been added.
>
>
> How can I get it to include new files?
>
>
> Frank Millman
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/git-users/5adeba65-4991-4bf8-93a1-12e22854a3ec%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CADOkX1d84%2Bf7b7FEWXb8pft45Am%2BERYsPswLssr_mrFaUJjsOw%40mail.gmail.com.


Re: [git-users] Gitignore add file or folder from terminal

2015-12-03 Thread Rainer M Krug
Good.

Just be sure that you use ">>" which will *append* to the file; while
">" will *overwrite* it!

Cheers,

Rainer

Vikram Mistry  writes:

> Hey Thanks...its working...
>
> On Thu, Dec 3, 2015 at 2:32 PM, Rainer M Krug  wrote:
>
>> vik...@tryjiffy.com writes:
>>
>> > Hi,
>> >
>> > Since everything we are doing from the terminal, then there should be a
>> > command to add the file in the gitignore through the terminal.
>>
>> Under Linux and OS X at least,
>>
>> echo "ignore.this.file" >> .gitignore
>>
>> should do it?
>>
>> Rainer
>>
>>
>> >
>> > Thanks.
>>
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
>> Biology, UCT), Dipl. Phys. (Germany)
>>
>> Centre of Excellence for Invasion Biology
>> Stellenbosch University
>> South Africa
>>
>> Tel :   +33 - (0)9 53 10 27 44
>> Cell:   +33 - (0)6 85 62 59 98
>> Fax :   +33 - (0)9 58 10 27 44
>>
>> Fax (D):+49 - (0)3 21 21 25 22 44
>>
>> email:  rai...@krugs.de
>>
>> Skype:  RMkrug
>>
>> PGP: 0x0F52F982
>>

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [git-users] Gitignore add file or folder from terminal

2015-12-03 Thread Rainer M Krug
vik...@tryjiffy.com writes:

> Hi,
>
> Since everything we are doing from the terminal, then there should be a 
> command to add the file in the gitignore through the terminal. 

Under Linux and OS X at least,

echo "ignore.this.file" >> .gitignore

should do it?

Rainer


>
> Thanks.

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [git-users] .gitignore ignored?

2015-10-02 Thread Sascha Manns
Hello Rusi,

thank you very much for your help. You was right, the issue is now solved.

Greetings
Sascha

Am Freitag, 2. Oktober 2015 06:11:26 UTC+2 schrieb rusi:
>
> On Fri, Oct 2, 2015 at 5:30 AM, Sascha Manns  > wrote: 
> > Hello list, 
> > 
> > actually i'm having some trouble by using git. My .gitignore shows: 
> > 
> > sascha@sascha-desktop:~/RubymineProjects/hoe-manns$ cat .gitignore 
> > Index.yml 
> > hoe-manns.gemspec 
> > .yardoc 
> > SetupConfig 
> > SetupReceipt 
> > README.txt 
> > doc 
> > ChangeLog 
> > pkg 
> > .teamcity 
> > .idea 
> > Changelog 
> > 
> > But a git status says me: 
> > 
> > sascha@sascha-desktop:~/RubymineProjects/hoe-manns$ LANG=C git status 
> > On branch develop 
> > Your branch is up-to-date with 'origin/develop'. 
> > Changes not staged for commit: 
> >   (use "git add ..." to update what will be committed) 
> >   (use "git checkout -- ..." to discard changes in working 
> directory) 
> > 
> > modified:   .idea/workspace.xml 
>
> A file that is in the repo (already) needs to be removed first to be 
> ignored. See: 
>
> http://stackoverflow.com/questions/1139762/ignore-files-that-have-already-been-committed-to-a-git-repository
>  
>
> I prefer this for the task (assuming changing history is ok) 
> https://rtyley.github.io/bfg-repo-cleaner/ 
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] .gitignore ignored?

2015-10-01 Thread Rustom Mody
On Fri, Oct 2, 2015 at 5:30 AM, Sascha Manns  wrote:
> Hello list,
>
> actually i'm having some trouble by using git. My .gitignore shows:
>
> sascha@sascha-desktop:~/RubymineProjects/hoe-manns$ cat .gitignore
> Index.yml
> hoe-manns.gemspec
> .yardoc
> SetupConfig
> SetupReceipt
> README.txt
> doc
> ChangeLog
> pkg
> .teamcity
> .idea
> Changelog
>
> But a git status says me:
>
> sascha@sascha-desktop:~/RubymineProjects/hoe-manns$ LANG=C git status
> On branch develop
> Your branch is up-to-date with 'origin/develop'.
> Changes not staged for commit:
>   (use "git add ..." to update what will be committed)
>   (use "git checkout -- ..." to discard changes in working directory)
>
> modified:   .idea/workspace.xml

A file that is in the repo (already) needs to be removed first to be
ignored. See:
http://stackoverflow.com/questions/1139762/ignore-files-that-have-already-been-committed-to-a-git-repository

I prefer this for the task (assuming changing history is ok)
https://rtyley.github.io/bfg-repo-cleaner/

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] .gitignore pattern

2015-01-06 Thread Dale R. Worley
Rainer M Krug  writes:
>> If you mean that the "base file name" 
>> (the name within the nearest containing directory) matches the regexp 
>> "EnergyBalance\.org.*", the "wildcard" version is "EnergyBalance.org*". 

> Just one question: why do you escape the "."? As far as I understand, it 
> has no special meaning in wildcard expressions?

In all "regexp" notations that I know of (e.g., arguments to grep), "."
is a pattern that matches any single character.  So when I say 'the
regexp ...', I have to quote any ".".

> PS: do I have to use the web interface to reply or is there an email 
> address, as I can not reply via gmane?

The address is .

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] .gitignore pattern

2015-01-06 Thread Rainer M Krug
On Monday, January 5, 2015 7:49:29 PM UTC+1, Dale Worley wrote:
>
> Rainer M Krug > writes: 
> > Actually, I would like to exclude all files which have the 
> > following pattern: 
> > 
> > EnergyBalance.org[SOMETEXT] 
> > 
> > I tried 
> > 
> > EnergyBalance.org[.] 
> > EnergyBalance.org[*] 
> > 
> > but none worked. 
>
> I don't know what notation you're using for the "following pattern".  


Sorry about the confusion - I did not use any in particular, but you 
understood what I meant.

Be aware that Git uses "wildcard" notation.  (Maybe it can be configured 
> for other types of notation.)  


That explains - somehow I thought it would use regexp - wildcards is much 
easier in this case.
 

> If you mean that the "base file name" 
> (the name within the nearest containing directory) matches the regexp 
> "EnergyBalance\.org.*", the "wildcard" version is "EnergyBalance.org*". 
>
> If you want to exclude such files no matter what directory they are in, 
> put that line in the .gitignore of the top working directory.  If you 
> want ot exclude such files in a particular directory, put 
> "/EnergyBalance.org*" in the .gitignore of the directory. 
>

Thanks - that works perfectly. I went one step further and added   

  /*.org\[*\]

so that all files of the pattern 

  basefilename: * 
  extension: org[*]

are ignored.

Just one question: why do you escape the "."? As far as I understand, it 
has no special meaning in wildcard expressions?

Thanks,

Rainer

PS: do I have to use the web interface to reply or is there an email 
address, as I can not reply via gmane?


> Dale 
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] .gitignore pattern

2015-01-05 Thread Dale R. Worley
Rainer M Krug  writes:
> Actually, I would like to exclude all files which have the
> following pattern:
>
> EnergyBalance.org[SOMETEXT]
>
> I tried
>
> EnergyBalance.org[.]
> EnergyBalance.org[*]
>
> but none worked.

I don't know what notation you're using for the "following pattern".  Be
aware that Git uses "wildcard" notation.  (Maybe it can be configured
for other types of notation.)  If you mean that the "base file name"
(the name within the nearest containing directory) matches the regexp
"EnergyBalance\.org.*", the "wildcard" version is "EnergyBalance.org*".

If you want to exclude such files no matter what directory they are in,
put that line in the .gitignore of the top working directory.  If you
want ot exclude such files in a particular directory, put
"/EnergyBalance.org*" in the .gitignore of the directory.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] .gitignore isn't ignoring.

2014-04-18 Thread Paul Smith
On Fri, 2014-04-18 at 12:49 -0700, gordonle...@gmail.com wrote:
> I've set intellij to ignore the three build files, but it too doesn't
> appear to be ignoring it.

.gitignore only impacts file which are untracked (that you've never
added or committed).  You can't ignore files that you've already told
git are interesting to you, even if you later add them to .gitignore.

> Changes not staged for commit: 
> (use "git add ..." to update what will be committed) 
> (use "git checkout -- ..." to discard changes in working
> directory)

> modified: build.number 
> modified: build.properties 
> modified: build.xml

This means someone already committed these files to the repository, and
you've now modified them.  They cannot be ignored.

If they were added to the repository by mistake (usually it's wrong to
add these kinds of build products to the repository, but different
groups do it different ways) then you have to run "git rm ..." to remove
them from your current version of the repository.  Then if they're
recreated, .gitignore will start ignoring them.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] gitignore change for tracked / untracked files

2014-01-31 Thread Thomas Ferris Nicolaisen
On Friday, January 31, 2014 7:36:52 AM UTC+1, Philipp Kraus wrote:
>
> Hello,
> sorry for the late answer.
>
> Am Mittwoch, 22. Januar 2014 21:27:18 UTC+1 schrieb Magnus Therning:
>>
>> I'm not 100% sure I understand what you wish to do, but you might want 
>> to look at `git clean`.  By default it just lists the files it would 
>> delete, you have to pass it '-f' to actually remove stuff.  You can 
>> also control whether you want it to deal with ignored files or not. 
>>
>
> I'm using gitignore like a black list, so my git ignore defines all files 
> which are not allowed.
> If I switch this to a white list, I need a check if everything is all 
> right. git clean works only
> with untracked files, but in my case I have got tracked files, which can 
> be after the gitignore
> changing also ignored. 
> Did you have got an idea, in which way I can change my gitignores, so that 
> I do not forget some files?
>

So, you want to change .gitignore
and then see which already checked-in files would have been ignored had 
they not been added already..

Well.. Here's a pragmatic approach:

cd repo
mv .git .. # move .git somewhere else temporarily
git init
git status --ignored # behold, all ignored files!
rm -r .git
mv ../.git . #revert to old state

If you don't want to toss your .git dir around, you can achieve the same by 
using the GIT_DIR variable:

cd repo
git --git-dir /tmp/foo.git init #just init an empty repo somewhere
git --git-dir /tmp/foo.git --work-tree . status --ignored  

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] gitignore change for tracked / untracked files

2014-01-30 Thread Philipp Kraus
Hello,
sorry for the late answer.

Am Mittwoch, 22. Januar 2014 21:27:18 UTC+1 schrieb Magnus Therning:
>
> I'm not 100% sure I understand what you wish to do, but you might want 
> to look at `git clean`.  By default it just lists the files it would 
> delete, you have to pass it '-f' to actually remove stuff.  You can 
> also control whether you want it to deal with ignored files or not. 
>

I'm using gitignore like a black list, so my git ignore defines all files 
which are not allowed.
If I switch this to a white list, I need a check if everything is all 
right. git clean works only
with untracked files, but in my case I have got tracked files, which can be 
after the gitignore
changing also ignored. 
Did you have got an idea, in which way I can change my gitignores, so that 
I do not forget some files?

Phil

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] gitignore change for tracked / untracked files

2014-01-22 Thread Magnus Therning
On Wed, Jan 22, 2014 at 11:50:16AM -0800, Philipp Kraus wrote:
> Hello,
> 
> I have defined a gitignore with file pattern, which should be ignored eg:
> *.tmp
> *.bak
> ...
> 
> I would change the gitignore file to:
> .*
> !*.cpp
> !*.res
> 
> but I would also removed tracked files, which are added to the repo if the 
> files does not match the ignore pattern.
> I would like to check the current files after changing the gitignore which 
> will not be matched and after that I will
> remove them from the repo
> 
> How can I do this

I'm not 100% sure I understand what you wish to do, but you might want
to look at `git clean`.  By default it just lists the files it would
delete, you have to pass it '-f' to actually remove stuff.  You can
also control whether you want it to deal with ignored files or not.

/M

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4 
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus

Most software today is very much like an Egyptian pyramid with
millions of bricks piled on top of each other, with no structural
integrity, but just done by brute force and thousands of slaves.
 -- Alan Kay


signature.asc
Description: Digital signature


Re: [git-users] .gitignore question

2013-11-15 Thread wtriker . ffe
Thanks for the replies. I did not understand the ** explanation vs * in the 
documentation. I'll give that a try.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] .gitignore question

2013-11-15 Thread Edwin Castro
On 11/13/13, 6:15 AM, wtriker@gmail.com wrote:
> '/system/cache' and all start with 'cache.'

Sounds like you want to match any number of directories prior to the
system directory. Try this pattern:

**/system/cache/cache.*

--
Edwin

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] .gitignore question

2013-11-14 Thread Dale R. Worley
> From: wtriker@gmail.com
> 
> I have some files that I want to ignore but can't seem to come up with the 
> correct format. There are multiple sub-directories with the same path that 
> I want to ignore. Specifically, the are '/system/cache' and 
> all start with 'cache.'. The .gitignore entry I am using is:
> 
> system/cache/cache.*
> 
> But that does not work. What is the correct syntax to ignore these files? 

One solution is to put "cache" in each /system/.gitignore file.

I would start by reading the rules for how gitignore entries are
interpreted, which is in the "gitignore" manual page.  In particular,
I see:

   Two consecutive asterisks ("**") in patterns matched against full
   pathname may have special meaning:

   ·   A leading "**" followed by a slash means match in all directories.
   For example, "**/foo" matches file or directory "foo" anywhere, the
   same as pattern "foo". "**/foo/bar" matches file or directory "bar"
   anywhere that is directly under directory "foo".

This suggests the answer is to put "**/system/cache" in the top-level
.gitignore file.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] .gitignore question

2013-11-13 Thread William Seiti Mizuta
Can you ignore all subdirectories inside cache directory? If so, just write

cache

in your .gitignore file. Git will ignore all cache directories
independently where it was. It can be in project root or inside a directory.


William Seiti Mizuta
@williammizuta
Caelum | Ensino e Inovação
www.caelum.com.br


On Wed, Nov 13, 2013 at 11:15 AM,  wrote:

> I have some files that I want to ignore but can't seem to come up with the
> correct format. There are multiple sub-directories with the same path that
> I want to ignore. Specifically, the are '/system/cache' and
> all start with 'cache.'. The .gitignore entry I am using is:
>
> system/cache/cache.*
>
> But that does not work. What is the correct syntax to ignore these files?
> TIA.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] GitIgnore Not including folders again

2013-10-21 Thread Dale R. Worley
> From: Rik Svendsen Rose 

> The folder that i want included is:
> 02 Microsoft SQL Server/xxx/MSSQL/Backup
> 
> 
> I have tried adding into my .gitignore folder:
>  
> 02 Microsoft SQL Server/**/
> !02 Microsoft SQL Server/**/Backup

I don't think that Unix-style shell globs define "**" to mean
anything.  Or rather, it has the same meaning as "*" -- any sequence
of characters not including "/".

Have you tried

!02 Microsoft SQL Server/xxx/MSSQL/Backup

There are further complexities of .gitignore that you might be able to
exploit:  If the line starts with "/", then the pattern must describe
the file's pathname starting from the current directory.  But if the
line does not start with "/", the pattern may match starting in any
subdirectory.  Thus, including "*.bak" causes any file ending in
".bak" to be ignored, no matter what subdirectory directory it is in.
That means that you might be able to use "!MSSQL/Backup" to un-ignore
the directories you are interested in.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] gitignore ignored?

2013-09-27 Thread Konstantin Khomoutov
On Fri, 27 Sep 2013 00:53:21 -0700 (PDT)
Mauro Sanna  wrote:

[...]
> When I push my commits I see target and its subdirs in the repository.
> But target is gitignored, why is it pushed?

There are several misunderstandings here:

1) Mechanisms for ignoring files in Git have nothing to do with pushing
   and fetching: these operations manipulate existing commits and
   references pointing at them.

   It's index updates (`git add`) and, in certain cases, work tree
   oprtations (`git rm`, `git clean` etc) which consider ignore lists
   (so that, say `git add '*'` won't add auto-built cruft added to
   an ignore list).

2) Mere updating of a branch in a remote repo does not do anything
   to "the subdirs in the repository" because such "subdirs" only
   occur in the work tree of a non-bare repository, and the push
   operation is not concerned about the work tree (short of respecting
   the receive.denyCurrentBranch configuration variable which forbids
   updating of a branch which is currently checked out in a non-bare
   repository).

   So it might be that if you actually *deleted* already tracked
   unwanted files and recorded a commit which does not contain them
   anymore and then arranged for them to be excluded by the Git file
   ignoring mechanism, and then updated a remote branch with your
   commit, you now need to actually update your work tree to the new
   state of the updated branch -- for instance, by doing

   git reset --hard

   in the work tree (provided the updated branch is what is currently
   checked out, -- otherwise a mere `git checkout ` would
   suffice).

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] .gitignore and branches issues

2012-09-03 Thread mem
On Sep 3, 2012, at 11:34 , Konstantin Khomoutov wrote:

> On Mon, 3 Sep 2012 02:29:12 -0700 (PDT)
> mem  wrote:
> 
>> While checkout to master branch, I got:
>> 
>> Error: The following untracked working tree files would be
>> overwritten by checkout:
>> nbproject/private/config.properties
>> nbproject/private/private.properties
>> nbproject/private/private.xml
>> nbproject/project.properties
>> nbproject/project.xml 
> [...]
>> dev is ignoring those files. master isn't, because no .gitignore file
>> is present there. Perhaps, when I was setting branches, I forgot it
>> somehow...
>> 
>> They should both ignore those files.
>> 
>> Plus, when I push this to remote repos, those changes should be
>> propagated for those remote repos as well. (I'm using a bare repo).
> 
> Since .gitignore is a part of the repository snapshot forming a commit,
> it will be "propagated" when people check out that state.

Ok.

> 
>> My question is:
>> 
>> *How can we add that .gitignore file to the master, so that this
>> doesn't happen again ?*
> 
> I'm a bit confused because the straightforward answer seems to be a
> bit too easy to be serious: "just check out the `master' branch,
> add .gitignore file and commit" or, alternatively, cherry-pick the
> necessary commit(s) which dealt with .gitignore from your "dev" branch.

Issue is solved. But thanks for your reply. 

I was enable to checkout the master branch, unless I force it:

git checkout --force master

Anyway, for the record: here's the steps I've done with help from others:

1) I have cloned the project to somewhere else.
2) I've checkout master on that clone.
3) Placed the gitignore into the master as it should have been there from the 
beginning: 
 git show dev:.gitignore > .gitignore
3) I've removed the files from the tree by doing git rm "all files that where 
on gitignore one by one"
4) I've added the .gitignore file to the repo.
5) commit it
6) switch back to the original repo and did:
7) git fetch /path/to/fix-project master:master
8) git checkout master, and I got:
Switched to branch 'master' 
Your branch is ahead of 'hub/master' by 1 commit.
this is my remote master branch.
9) Pushed to remote master.
10) checkout dev again


Thanks again for your reply.



-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] .gitignore and branches issues

2012-09-03 Thread Konstantin Khomoutov
On Mon, 3 Sep 2012 02:29:12 -0700 (PDT)
mem  wrote:

> While checkout to master branch, I got:
> 
> Error: The following untracked working tree files would be
> overwritten by checkout:
> nbproject/private/config.properties
> nbproject/private/private.properties
> nbproject/private/private.xml
> nbproject/project.properties
> nbproject/project.xml 
[...]
> dev is ignoring those files. master isn't, because no .gitignore file
> is present there. Perhaps, when I was setting branches, I forgot it
> somehow...
> 
> They should both ignore those files.
> 
> Plus, when I push this to remote repos, those changes should be
> propagated for those remote repos as well. (I'm using a bare repo).

Since .gitignore is a part of the repository snapshot forming a commit,
it will be "propagated" when people check out that state.

> My question is:
> 
> *How can we add that .gitignore file to the master, so that this
> doesn't happen again ?*

I'm a bit confused because the straightforward answer seems to be a
bit too easy to be serious: "just check out the `master' branch,
add .gitignore file and commit" or, alternatively, cherry-pick the
necessary commit(s) which dealt with .gitignore from your "dev" branch.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Gitignore

2011-12-02 Thread Konstantin Khomoutov
On Fri, 2 Dec 2011 12:13:43 -0300
Flávio Alencar  wrote:

> I have two questions:
> 
> 1 - Do I have to configure the gitignore before running the first
> commit?
No. It's just a way to hide certain files from certain commands
operating on files (such as git-status or git-add).
git-commit does not operate on files and does not use .gitignore.
Moreover, Git does not need this file to be tracked.  Just some
commands see if it's there and use it if it is.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.