gitignore

Is it possible to make .gitignore changed according to environment variables

混江龙づ霸主 提交于 2019-12-02 18:03:22
问题 Is it possible to add to .gitignore rules depends on environment variables? for example if -e $(ENV_VAR) "AAA" !liba.so else liba.so Basically what I want is to have a repository such that if ENV_VAR = "AAA" the local repository will have a.txt and if ENV_VAR isn't set the a.txt will be removed. 回答1: The answer is no. Gitignore rules are completely static. Further that would not even make any sense. Once a file is in the repo, gitignore does not apply to it anymore – it only prevents new

Configure git to track only one file extension

血红的双手。 提交于 2019-12-02 17:12:44
I have one directory tree with many kind of different files. There are 300 directories on the parent directory. Each directory could have other sub directories. I only want to track *.cocci on all sub directories. Here is my .gitignore: * !*.cocci But it do not work, as the files on sub directories are not tracked. How can I tell git that I only want to track *.cocci on all sub directories? simont Read this question . You want: # Blacklist everything * # Whitelist all directories !*/ # Whitelist the file you're interested in. !*.cocci Note, this'll track only *.cocci files. Yours doesn't work

git excludes vs ignores

ぃ、小莉子 提交于 2019-12-02 17:04:45
I use Tower for using Git in Mac. The settings in Tower has Ignores section which creates the .gitignore, but it has another section named "Excludes". And it seems like that one can use excludes with "# git ls-files --others --exclude-from=.git/info/exclude". What Excludes is for? Why one needs excludes when gitignore is available? It's a list of files that are not in .gitignore (which can be versioned), but which you want to exclude on your machine's copy of the repo. From the docs : Patterns which are specific to a particular repository but which do not need to be shared with other related

Why is .gitignore not ignoring my files?

二次信任 提交于 2019-12-02 16:10:04
See the image below. My .gitignore file should be ignoring all files in src/dist, but isn't. .gitignore only ignores files that are not part of the repository yet. If you already git add ed some files, their changes will still be tracked. To remove those files from your repository (but not from your file system) use git rm --cached on them. The .gitignore file ensures that files not tracked by Git remain untracked. Just adding folders/files to a .gitignore file will not untrack them -- they will remain tracked by Git. To untrack files, it is necessary to remove from the repository the tracked

.gitignore NuGet exclude packages/ include packages/repositories.config

余生长醉 提交于 2019-12-02 16:08:39
I'm trying to create a .gitignore for a Visual Studio project that uses NuGet. It currently contains: \packages/* !packages/repositories.config This does not ignore anything in the folder. Everything gets staged on an add. I have also tried: packages/ !packages/repositories.config This ignores everything in the packages folder and does not include the packages/repositories.config. What am I doing wrong? manojlds /packages/ !packages/repositories.config You can also add a .gitignore in the packages folder: * !repositories.config !.gitignore I faced the same issue. None of the above solutions

“You must type a file name” error thrown, when I create a .gitignore file on Windows

梦想的初衷 提交于 2019-12-02 16:02:54
When I try to do this, I get the following error: Obviously, Windows Explorer doesn't allow me to create this type of file patterns. How can I overcome this problem? I arrive a little late but will give you the trick!! ;-) In the File Explorer, call your file .gitignore. and it will remove the ending '.' Or use a text editor... Windows Explorer doesn't allow you to create files that consist essentially of a file extension only. This is because Windows Explorer has the option to hide file extensions, leaving you with a file you cannot see (see Why doesn’t Explorer let you create a file whose

What should I put in a meteor .gitignore file?

徘徊边缘 提交于 2019-12-02 16:01:51
I have a new meteor project. I'm guessing the .meteor dir has a combination of configuration files (needed) and temporary files (not needed). So what's in your .gitignore ? debergalis The only directory you want excluded from version control is .meteor/local . Meteor automatically creates the right .meteor and .meteor/.gitignore , though -- you shouldn't need to do anything. You might want to put any configuration settings files in there if you are pushing to a public repos. I store any security sensitive data configuration settings like encryption keys and various passwords for services like

How to use conditions in gitignore

♀尐吖头ヾ 提交于 2019-12-02 15:51:09
问题 I'm managing several pdf and graffle files with git. I want to add pdf files to repository only if graffle with same filename does not exists, e. g. only add foo.pdf and bar.graffle into repository in the directory $ ls foo.pdf bar.pdf bar.graffle If such target can't be completed only with gitignore , is there any work arounds exist? bar.pdf can only be generated with bar.graffle through several steps in GUI, so I want to keep them on commit. 回答1: Note that .gitignore only exists as a hint

Why doesn't my global .gitignore file ignore?

偶尔善良 提交于 2019-12-02 15:29:26
$ cat ~/.gitconfig [core] editor = vim excludefiles = /home/augustin/.gitignore $ cat ~/.gitignore toto $ mkdir git_test $ cd git_test/ $ git init $ touch toto $ git status # On branch master # # Initial commit # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # toto nothing added to commit but untracked files present (use "git add" to track) $ git --version git version 1.6.3.3 Why isn't toto being ignored? Other settings in ~/.gitconfig are taken into account (colors, editor). git config --global core.excludesfile ~/.gitignore You may find this question

Cordova 5.0.0: Which files should I commit to git?

岁酱吖の 提交于 2019-12-02 14:20:57
I use Cordova 5.0.0 and i have the following project structure: MyProject - hooks - platforms - plugins - resources - www - config.xml My question now is: Which of these folders can I omit? I ask it because I work on three different platforms. I Develop on linux for android, windows for windows phone and on mac for ios. If I commit the whole project I always get warnings and error for the not supported platforms. What I want is a minimalistic git repository. One problem for example are the plugins. When I delete the plugin folder from the repository I have to add them on each of my developing