gitignore

How to permanently prevent specific part of a file from being committed in git?

风格不统一 提交于 2019-11-29 17:54:29
问题 I have cloned a remote SVN repository with git-svn. I have modified a pom.xml file in this cloned repo in a way that the code compiles. This setup is exclusive for me. Thus I don't want to push the changes back on the remote repo. Is there a way to prevent this (partial) change of a file from being committed into the repo? I'm aware of the fact, that I could use a personal branch, but this would mean certain merging overhead. Are there other ways? I've looked into this question and this one,

Should package-lock.json also be published?

假装没事ソ 提交于 2019-11-29 16:35:57
问题 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? 回答1: It

.gitignore Doesn't Seem To Work

爱⌒轻易说出口 提交于 2019-11-29 15:17:51
My .gitignore: .DS_Store /.idea /.idea_modules /out /project /target /*.iml */resolution-cache/* */streams/* */target/* But nonetheless, the folders .idea , .idea_modules and target have appeared in a repo and are still there. Your ideas? Max Ignoring is only useful for files that are not currently being tracked by the repo. If those directories were added to the repo before being put in .gitignore, they will continue to be tracked. Use git rm --cached <file> to stop tracking a file. Of course you should make a commit with the removed files and push to the repo to see the changes in the remote

git creates files ending in ~?

情到浓时终转凉″ 提交于 2019-11-29 13:09:46
Just started using git on my mac. I have one file in my repository called README . When I change it, git puts another file in the directory called README~ containing the previous version. Is it git doing this? Why is git doing this? How can I stop git doing this? (don't just want to add it to .gitignore , but I guess I could do that but I'd rather understand why I'm getting these files in the first place..) (It's hard to search for an answer on Google cos of trying to search on "~") The tilde suffix on file names is usually used by editors (Emacs, Vim in some modes/versions) on backup copies

Git ignore - How do you override an exception to an ignore-all?

。_饼干妹妹 提交于 2019-11-29 12:50:15
I want to create a git repo of my bash settings and plugins and whatnot. I have ignored everything (line 0) and then manually added the files/folders that I want in the repo. (I have to do it this way because the repo is in my ~ folder.) I want to ignore all colour profiles in the .vim/colors/ directory, but I do want to include the one file that I am using (apprentice.vim). The .vim/colors/* line doesn't seem to work - it doesn't ignore any of the files at all. Using !!.vim/colors/* doesn't work either. How am I supposed to make it override all previous rules and ignore the colors folder,

Eclipse Git gitignore file is ignored

梦想与她 提交于 2019-11-29 11:09:14
I have an Android project in which I wish GIT to ignore the bin and gen folders. Therefore, I have placed in the directory of the project (I have also tried it at a level higher) the following .gitignore file: # built application files *.apk *.ap_ # files for the dex VM *.dex # Java class files *.class # generated files bin/ gen/ # Local configuration file (sdk path, etc) local.properties # Eclipse project files #.classpath #.project Unfortunately, this file is being ignored by Eclipse and I keep committing .class files and files from both gen/ and bin/. I have also tried to mark the folders

Regex-like shell glob patterns for gitignore

可紊 提交于 2019-11-29 09:53:24
When I compile my C++ project, many shared object files are created with extensions such as .so .so.0 .so.7 .so.0.7 I need to add all those to my .gitignore file. Were this a regex, I could use \.so[\.0-9]* However, the documentation says that .gitignore treats the pattern as a shell glob suitable for consumption by fnmatch(3) with the FNM_PATHNAME flag I found no way to do what I want with the fnmatch documentations I found. Is there really no way to do this? While the answer by @SpeakEasy can ignore .so files in a single step using *.so* , for your use case of ignoring files in formats

Definitive retroactive .gitignore (how to make Git **properly forget** (historically) about a file now in .gitignore)

醉酒当歌 提交于 2019-11-29 09:02:05
Note : This question attempts to clear the confusion regarding applying .gitignore retroactively , not just to the present/future. 1 Rationale I've been searching for a way to make my current .gitignore be retroactively enforced, as if I had created .gitignore in the first commit . A proper solution: Will NOT require manually specifying files Will apply retroactively to all commits of all branches Will ignore .gitignore-specified files in working dir, not delete them (just like an originally root-committed .gitignore file would) Will use git, not BFG Will apply to .gitignore exceptions like: *

Track local ignored files with Git

自古美人都是妖i 提交于 2019-11-29 08:14:54
In our repository some files and folders are ignored. Of interest here are: Build output folders which contain (among others) some configuration files and external binary modules. Note that this means that those files of interest are located within already ignored folders ("bin" folders). Setup scripts which are placed along source code. Those scripts are ignored because they are programmer-specific (for example they contain paths to external libraries on local machine). Yet I would like to trace those files for myself only. Mostly to recreate them easly after cleaning but there are other

Repo specific ignore files in git

独自空忆成欢 提交于 2019-11-29 07:55:49
Is it possible to have repo specific .gitignore files? Eg: [origin] .gitignore: foo1.* foo2.* [another] .gitignore: bar1.* bar2.* The purpose behind this is that we deploy using git on to a managed cloud service and we'd like to keep dev files in version control but not push them to a repo. Yes, you can put per repository ignore patterns in .git/info/exclude in each repository. (Note, this only affects what is ignored in each repository, it won't affect files that you actively place under source control and the push. I'm not completely clear on your desired use case.) Yes you can, just can't