gitignore

gitignore directory pattern ignores folder with same suffix, but I want to include it

你说的曾经没有我的故事 提交于 2019-11-30 17:50:18
I have the following directory structure: src/ out/ cout/ ... and I want to ignore out/ but not cout/ . I've tried putting ^out/ , but that doesn't seem to work. I've also tried out/ but that also ignores cout/ . Any suggestions? Exclamation mark(!) should precede a match which should not be ignored. The .gitignore file should look like: out/ !cout/ Sorry guys, my mistake! The cout directory was empty and, therefore, not showing up under git status . Just adding out/ works fine and doesn't ignore cout/ . Thanks a lot! Which version of git are you using? With msysgit 1.6.3-preview20090507-2,

How do I push files specified in .gitignore?

浪尽此生 提交于 2019-11-30 14:54:59
If I have a "vendors" directory in my .gitignore, is there a way I can set up a remote that will receive that directory anyway when I do a push? I think the functionality you're looking for can be achieved by having a branch used to deploy to your Cloud Provider. Setup a dev branch which includes your .gitignore file, check your incremental work into that branch. Merge your dev branch into your deploy branch which doesn't contain a .gitignore file but contains the vendors directory. once you've completed your merge, push to the deployment remote from your deploy branch. Your .gitignore file

GIT: How to keep ignored files when switching branches?

末鹿安然 提交于 2019-11-30 14:20:51
I have an App.Local.config file which each developer has their own settings in. I do not want this file checked versioned in the GIT repo as every time it would be overwritten by another developers changes. So I deleted the file from the repo and added it to the ignore file. But now when developers switch branches, App.Local.config is deleted from their local filesystem. Ultimately what i would like is: new dev clones repo, gets a starting version of App.Local.config dev makes changes to App.Local.config. Git will ignore changes and not stage/checkin dev switches branches, changes to App.Local

Subfolders in .gitignore

*爱你&永不变心* 提交于 2019-11-30 13:49:59
问题 I have many subfolders in my repo, in which there are few build/ directories I'd like to ignore when committing my code. As I understand it, there are two ways to ignore all of the folders: */build/ (Unix wildcards) build/ ( git way of ignoring files/folders) I've found Git ignore sub folders but it has two answers and I would like to know what the difference (none?) between the two approaches is . Does the same rule apply to files? 回答1: build/ is the right way to do it. It will ignore any

How do I ignore file extensions in git regardless of case?

◇◆丶佛笑我妖孽 提交于 2019-11-30 13:39:34
问题 I want to tell git to ignore e.g. jpg files regardless of how the extension is written. e.g. *.jpg should ignore .jpg, .JPG., .Jpg etc. Is that possible without telling git to ignore case altogether? 回答1: Git ignore understands glob pattern, so you can use this *.[jJ][pP][gG] 回答2: You can tell git to ignore case in most situations, including in your .gitignore files. All you need is: git config core.ignorecase true From a practical point of view, there may be trade-offs involved. The git

Git ignore: How to match one or more digits

耗尽温柔 提交于 2019-11-30 13:30:33
I would like to make sure that git ignores any log files that are created on a rotating basis. For instance debug.log debug.log.1 debug.log.2 debug.log.10 should all be ignored. I am currently using *.log and *.log.[0-9] to ignore the first 3 in the list. To capture the third, I know I could use *.log.[0-9][0-9] . However, I'd prefer to find a one line solution that could capture all of these. Is there a way to tell the gitignore file to match one or more digits? Sadly but .gitigore use glob instead of regex for matching, which means there's not a good way to do it. Otherwise, Git treats the

Heredoc in a Makefile?

女生的网名这么多〃 提交于 2019-11-30 13:13:42
问题 Is this possible at all and how? Update: I need this because I create a file both from dynamic and static data. Use case: I have a test directory. Each C file produces a test executable. With SRCS = $(wildcard [a-z]*.c) I can add new tests as needed and make will find the new tests, compile, run and valgrind them. I also use git. I would like .gitignore to include the executables. So there. How to create .gitignore and include static data, i.e. the files I want to be ignored ( *.o and depend

Protecting files in git repository

左心房为你撑大大i 提交于 2019-11-30 12:42:21
I have a central repository with a subset of files that I want to protect from being changed (by pushing) from other users. If I add these files to .gitignore , they would not be cloned. Is it possible to give the ability to clone all files, but after cloning add some of them to .gitignore on the client side? You can have the files in the repository, commit them, then add them to the .gitignore and then remove them from the next commit. You can still fetch the files directly prior commit (perhaps tag it with something so it can be fetched by name a bit easier) and this will preserve the state

Should package-lock.json also be published?

早过忘川 提交于 2019-11-30 11:03:39
npm 5 introduced package-lock.json , of which the documentation is here . It states that the file is intended to be included with version control, so anyone cloning your package and installing it will have the same dependency versions. In other words, you should not add it to your .gitignore file. What it does not state is wether or not the file is intended to be included with a published package. This question could be rephrased as; should package-lock.json be included in .npmignore? It cannot be published. From the npm documentation: One key detail about package-lock.json is that it cannot

Can you have additional .gitignore per directory within a single repo?

二次信任 提交于 2019-11-30 10:32:18
问题 Can you create a .gitignore file in a directory that only applies to files (and directories) within that directory? 回答1: Yes, you can. Try it, it works fine. Put a .gitignore in the root of your repo, and put another .gitignore with additional things to ignore in a subdirectory. 回答2: Similar question was: Are multiple `.gitignore`s frowned on? (Jul 2010) Or if you can have different version of a .gitignore file per branch: Using github to host public git repositories whilst ensuring that