2

I wanna to ignore .gitignore action when cloning ?

for example)

Repository has following files.

A.txt B.o .gitignore <- .gitignore defines *.o

So my local repository has only A.txt when cloning.

But I want to have A.txt B.o .gitignore when cloning.

Thank you thenducks!

john
  • 2,054
  • 4
  • 20
  • 25

1 Answers1

3

Cloning has nothing to do with .gitignore, the reason those files aren't being cloned is most likely that... well... they're ignored! So if you want B.o in the repo (and as a result, in clones) then simply add that file to the repo with git add -f B.o and commit it.

rfunduk
  • 30,053
  • 5
  • 59
  • 54
  • 2
    In other words, cloning clones from the _repository_ (that's, eg, the `.git` directory that you can't see) and not from the working directory. The only way to get a file as part of a clone is to have it committed into the repo. – rfunduk Sep 15 '10 at 14:43
  • In fact it's usually better to do your pulling (in general) from a bare repo and not from one someone is working on anyway (as in, there shouldn't be a working directory at all). – rfunduk Sep 15 '10 at 14:43
  • See [this question](http://stackoverflow.com/questions/8584890/git-default-files-ignoring-after-first-pull) if you are looking for a similar solution but want `B.o` to be ignored every time it is changed. – Senseful Aug 14 '14 at 00:34