Score:0

How to exclude ELF 64-bit LSB shared object from uploading to git?

bh flag
utk

I'm trying to include ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked files generated in gitignore by including .elf extension in .gitignore file but it's not working.

Please help!

muru avatar
us flag
Does the file have a `.elf` extension? `.gitignore` doesn't examine the contents of the file, only the name and path.
utk avatar
bh flag
utk
The file has no extension. When i enter `file file_name` i get `ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=cd62fa73c4967943119c4535db916c79db220f52, not stripped`
Score:0
es flag

Since generated binaries don't have a filename extension on Linux systems (unlike Windows .exe) files, there is no way to generically ignore all of them in .gitignore. You have to list each one separately.

Example: https://github.com/shundhammer/qdirstat/blob/master/src/.gitignore

...
qdirstat
...

Yes, that's annoying, and no, there is no better solution. But since you know what executables you create, and there is usually only one (or at most a very small number), it's not a big deal.

utk avatar
bh flag
utk
I added the file names directly in the `.gitignore` file but still, they're getting committed.
HuHa avatar
es flag
Are those files already in the git repo? In that case, `.gitignore` does not have any effect. Also make sure you either add it to the `.gitignore` in the same directory, or, if you use one some directory level(s) up, add the relative path.
utk avatar
bh flag
utk
As earlier they were already uploaded, first I deleted them from the repo and then made the changes in `.gitignore` and committed the changes but still those files got uploaded. The shared object files are not present in the same directory but inside a subdirectory whose relative path I added to the `.gitignore` file with the file name. The shared object files are formed after the compilation of D files, which creates an object file and the above-mentioned ELF shared object file.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.