27

I've got a compiled static library (with an "a" extension) I want to include in my SVN repository but adding it never works (no problems adding other types of items). If I change the extension (e.g., "library.a" --> "library.b"), the add works. Why is the "a" extension failing? Is there a way around this without renaming the file?

Jon
  • 1,469
  • 1
  • 14
  • 23
  • 2
    What does "svn status --no-ignore" tell you ? Does it see the *.a files ? – jtm Mar 06 '10 at 23:15
  • 2
    The I in front means the file is being ignored. Since the global is not ignoring you have a local ignore. do "svn propedit svn:ignore" – jtm Mar 06 '10 at 23:27
  • This was also discussed here: http://stackoverflow.com/questions/2125303/svn-propget-svnignore-returns-nothing-but-svn-is-obviously-ignoring-my-files/2125487#2125487 – Ether Mar 07 '10 at 00:16

6 Answers6

57

Have you checked your global ignore settings. On linux they are stored in ~/.subversion/config

The default on my machine is :

global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo

so it ignores *.a files

more info here

You should be able to add the file with

svn add "file" --no-ignore

to bypass any ignore rule set.

If the command:

svn status --no-ignore

returns with I in front you have a local Ignore. Run:

svn propedit svn:ignore
jtm
  • 1,535
  • 18
  • 19
  • Thanks for this. I'm on Mac OS X and in my ~/.subversion/config file, the global-ignores is set to the default: `global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store` which does not include *.a. – Jon Mar 06 '10 at 23:11
  • 2
    I'm on OS-X (10.8.latest) and my global-ignores is commented out, which I read to mean "no global-ignores." Yet, whenever I add a directory with a library .a file (example: 3rd party libs, such as Flurry), it always skips the .a file. Then my client can't build, then I go back and `svn add somelib.a` explicitly, then all is good. Is there a way to **turn off** this default "skip all the .a-s" behaviour? Thanks! – Olie Sep 12 '13 at 17:24
  • 1
    @Olie You must not comment the global-ignores out! Make sure that they are not commented out but remove the *.a from the list of ignored files then it will work. – denim Jan 09 '14 at 13:34
  • Maybe its worth to add that - in TortoiseSVN - these global ignores can be found and editied in the TortoiseSVN settings itself (rightclick -> Settings/General) – Heri Apr 21 '20 at 12:45
4

So, I suggest actually edit that ~/.subversion/config file to allow .a files again:

global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.pyc *.pyo
#global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo

Because I have a lot of those .a files in my projects.

Jonny
  • 15,955
  • 18
  • 111
  • 232
  • I had to the very same thing w/1.7. Even when commented out, SVN decided to global ignore files anyway. Violation of the principle of least surprise for sure. What am I not understanding? – Brian Ledsworth Feb 08 '17 at 17:17
3

On Mac OSX (Lion) I'm using SCPlugin (http://scplugin.tigris.org/).

This adds a nice finder popup with SVN commands on it and it allows me to add *.a files when svnx or xcode don't allow it.

I suspect it's actually a bug as it's clearly ignoring the correct ignore settings (ironically), but for those who don't want to mess with terminal, it's proving handy.

EDIT: SmartSVN also allows you to see ignored files so they can be added as any normal file. Just check the 'ignored files' options under the view menu.

Danny Parker
  • 1,713
  • 18
  • 30
1

By the way, if you're using SVN import (i.e., not a working copy), you can override the global ignores with:

--config-option=config:miscellany:global-ignores=[new ignores]
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
joshbodily
  • 1,038
  • 8
  • 17
1

We can add library on svn:

svn add library.a --no-ignore

After add svn need to be update:

svn update

Commit changes on svn using:

svn commit -m "library.a added on svn"
Pranav Singh
  • 17,079
  • 30
  • 77
  • 104
Irfan Khatik
  • 146
  • 7
0

I have met this question recently, this is my way:

svn import --no-ignore --force  svn://destination
joshbodily
  • 1,038
  • 8
  • 17