gitignore

Is there a way to have ignored files show up in git status?

余生颓废 提交于 2019-12-24 10:55:38
问题 Is there a way to mark a file in Git such that a "git add ." won't stage it but have it still show up under git status? I know this sounds crazy, but the reason is I have some local script files that I'd like to see in my git GUI (Tower) browse window, however I don't want them added to the repo when I "stage all". If I untrack the files and set status showUntrackedFile = Normal (or all) they show up, but then they get added back in by "git add ." or "Stage All". If I put them in .gitignore

Whitelist nested files and folders using .gitignore

心不动则不痛 提交于 2019-12-23 23:40:37
问题 I want to exclude entire android/ & ios/ folder And I want to include the following files in it: android/settings.gradle android/app/build.gradle android/build.gradle android/app/src/main/java/com/reactnativegoogleadmob/MainApplication.java ios/Podfile ios/ReactNativeGoogleAdmob/AppDelegate.h ios/ReactNativeGoogleAdmob/AppDelegate.m So my .gitignore is: # Remove following directories android/* ios/* # Add following files !android/settings.gradle !android/app/build.gradle !android/build.gradle

How to forbid git commit if there are untracked files?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 13:08:56
问题 Sometimes, it makes sense to forbid git commit when there are untracked files, because you should add them either to files to commit or gitignore. And an option like -f to force this commit is also necessary. So is there any option/plugin/etc to do that? Thank you very much. 回答1: You can add a pre-commit hook that exits with a non-zero value if you find untracked files (you could examine the output of git status --porcelain -u to determine their presence--look for lines beginning with "?").

gitignore based on unix file permissions

你离开我真会死。 提交于 2019-12-23 11:53:34
问题 I am working on a C project which generates lots of binaries. I try to keep the source under source control. However, I would like the binaries to be ignored without having to add them to the gitignore file whenever I create a new one. This is a sandbox of sorts and so I create lots of new binaries as I try out new things. I could build all my binaries in a single directory or give them a suffix, but I dislike these reasons. Since GCC automatically sets the executable bit on the binaries it

Git: File that must be distributed, but ignored / not reuploaded? [duplicate]

回眸只為那壹抹淺笑 提交于 2019-12-23 09:37:08
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: git: can i commit a file and ignore the content changes? I have a simple problem, and I hope there's a simple solution. Using Git (and Tower, great app), I have a repository that has a file that everyone needs to download when they clone the repo, BUT that file should never be reuploaded with changes (because it's a configurtion file, with database-specific usernames / passwords, and paths) - the changes are

How to not ignore everything in the parent repo when the child repo ignores everything?

↘锁芯ラ 提交于 2019-12-23 06:49:19
问题 I have a repo that ignores everything except a few files and the .gitignore looks like this: # first ignore everything * # then whitelist what's needed !*/ !.gitignore !wordpress/wp-content/plugins/check-last-login/* !wordpress/wp-content/plugins/wp-issuetracker/* !mediawiki/extensions/single-signon/* This repository is a child repository. It is inside of another repository, the parent. The child repository is ignoring everything except the few things just fine, but the parent is also doing

Limit depth of .gitignore

喜欢而已 提交于 2019-12-22 10:50:00
问题 For various reasons, I have the entry in my .gitignore in the root of a project: *.c As I desire, this ignores all C files from being included. However, I really only want the C files to only be ignored in the root directory, and not all the sub-directories: foo.c bar.c folder/baz.c In the above scheme, I only want foo.c and bar.c ignored. I do not want this gitignore rule to work recursively. How do I do this? I'm aware of being able to negate the rule with !*.c , but I'd rather not do that

Can git filter out certain lines before commit?

孤街浪徒 提交于 2019-12-22 10:28:57
问题 I have a repo on github that I am working out of and I often have comments on my .py files that starts with the " # TODO: " to keep a personal note of things to be done. # TODO: do this <code> I obviously do not want that to go in a commit. I want GitHub to search all the files when I am about to commit them and not include lines that start with # TODO: Does Git already do this? I know certain version control like perforce already have this feature. Any thoughts? 回答1: I want GitHub to search

Does .gitignore work on commit, push, or upon reaching the server?

不想你离开。 提交于 2019-12-22 09:39:56
问题 Say I have a .gitignore to ignore all .class files. Are these files kept out of the remote origin when... I commit/add my files locally? Does my git look for a .gitignore when add/commit is used, and based on what it says, removes things from the commit? I push my commits? Does git git only push files that aren't being described in the .gitignore ? It reaches the origin? Does the server that is holding the git repository keep out files based on it's .gitignore ? 回答1: I commit/add my files

Git is not using the contents of .gitignore

天涯浪子 提交于 2019-12-22 08:22:38
问题 I’m working with Rails and added the directory tmp and the Gemfile to my .gitignore. But every time I change it, git status tells me, that it changed. On both machines. On my developer machine and on the server. Kind of annoying. Contents of .gitignore : .DS_Store data/export/*.csv tmp/* *.rbc *.sassc .sass-cache capybara-*.html .rspec /.bundle /vendor/bundle /log/* /tmp/* /db/*.sqlite3 /public/system/* /coverage/ /spec/tmp/* **.orig config/*.yml rerun.txt pickle-email-*.html Gemfile* 回答1: It