gitignore

Best way to add sub module ignored content

早过忘川 提交于 2019-12-06 20:56:35
I'm using a repository (B) as a submodule of my project (A). In that repo (B), there is an ingored directory, dedicated to local config files for that project. I'd like to version the content of that directory from my own project (A). Since those files are gitignored from (B), I thought I could simply git-add them but I get fatal: Pathspec 'oh-my-zsh/custom' is in submodule 'oh-my-zsh' . What is the best way to do that (I'd rather not change anyting in (B))? I'd suggest using a symlink to the local files: a ├── b │ └── local -> ../b-local └── b-local This nicely separates content of repo a

Should I add .idea/workspace.xml to gitignore?

青春壹個敷衍的年華 提交于 2019-12-06 18:47:39
问题 When I try to checkout another branch, I get this error: error: Your local changes to the following files would be overwritten by checkout: .idea/workspace.xml Please, commit your changes or stash them before you can switch branches. Aborting I did some research and it seems some people avoided this problem by adding the afformentioned file to gitignore . Is this a wise thing to do? If git is ignoring your workspace.xml file, won't it mess up your experience in the IDE (in my case, Jetbrains

What should I include in the .gitignore file for Swift playgrounds?

懵懂的女人 提交于 2019-12-06 18:04:49
问题 I want to use Git for versioning my playgrounds, but I am not sure which files should be ignored and which ones I should commit. Currently I use following .gitignore file for playgrounds: # Xcode user data xcuserdata What else should be there? 回答1: From the official github gitignore for Swift ## Playgrounds timeline.xctimeline playground.xcworkspace 回答2: Whether it is a normal project or playgrounds, it is convenient and useful to use one of the standard .gitignore files for Swift. From the

.gitignore: How do I ignore nested directories?

孤街浪徒 提交于 2019-12-06 16:37:56
问题 I have the following directory structure: test/a test/b/c test/a/b/Ouput test/c/d/e/Output test/f/Output I want to ignore all the "Output" directories under "test". I tried test/**/Output , but it didn't work. What am I doing wrong? 回答1: You said you want the Output/ pattern to match only under the test/ directory, so in the test/ directory, create a .gitignore file with the contents: Output/ If you put this pattern in your top-level .gitignore file, then it will match in all directories

gitignore - allow folder creation but ignore all files inside - can we do it with exclamation mark (!)?

こ雲淡風輕ζ 提交于 2019-12-06 14:23:23
问题 When we push a certain project somewhere, we wish to deploy empty necessary folders too. For example: /runtime/ folder. However, we must ignore all files inside /runtime/* ; I'm aware of " the create a useless file inside your empty directories " solution and also, aware of some sort of bash process to make that add of useless files automatic, but isn't there any other way? I mean: Is it possible to accomplish this by having on our .gitignore something like: !/runtime/ /runtime/* 回答1: No, not

.gitignore and node_modules

夙愿已清 提交于 2019-12-06 13:43:03
I am trying to figure out the best way to handle node_modules in git. From what I read, there are two options: A. Keep all the node_modules in the git repository, together with my project. This way, a person cloning my project does not have to install any modules. B. Don't keep any node_modules in the git repository, i.e., have a ".gitignore" file that contains "node_modules". However, in some projects, I don't see any of these two options. For example, in this node.js project , there are no node_modules, but also no .gitignore file... When I fork this repo, and do npm install , the folder is

laravel symlink is changed when code is pushed to live site

大兔子大兔子 提交于 2019-12-06 12:46:52
I am using laravel 5.5's storage symlink to store images. When I push code to the git and pull from live site then symlink path on live site becomes same as is on my local code . My local has this symlink storage -> /home/path/to/project/app/public/ But live site expects this symlink path storage -> /var/www/html/website.com/public_html/project_code/storage/app/public/ Every time I have to delete symlink and create it again on live site. I have do these steps on live site cd public rm storage cd .. php artisan storage:link after doing these steps my symlink becomes according to live site and

Vanishing file included in .gitignore

时光毁灭记忆、已成空白 提交于 2019-12-06 11:17:20
问题 this is probably naive question: i have file config.yml which is in .gitignore file when I'm switching branch to 'someotherbranch' and next i switch back to master then I don't see config.yml why ignored files are vanishing after switching branch and what can I do to avoid it? 回答1: Files which are tracked AND ignored are treated like normal files. This usually happens if you ignore the files after you've added them. Lets say you add a file 'ignored', commit it, then create two branches

Managing a framework with Git, ignoring changes to given files after first pull

我怕爱的太早我们不能终老 提交于 2019-12-06 11:15:45
I'm using git to manage an extended CodeIgniter Framework. It's a clone of the current CI release with extra helpers, libraries ect. I have many sites all using this framework and if I add a new helper method or fix a bug in one site I want to be able to easily update all the other sites without overwriting any of their custom files. I wish to achieve the following workflow Create a new site directory git init to initialise a blank local git repo Link this with the remote framework repo git remote add origin git@github.com:username/framework_repo Pull a fresh copy of the remote framework git

Where is gitignore recursive behavior specified?

僤鯓⒐⒋嵵緔 提交于 2019-12-06 08:57:16
Referring to the online docs : If the pattern does not contain a slash /, Git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file (relative to the toplevel of the work tree if not from a .gitignore file). To me, this documentation says that given a pattern 'foo', any file or directory named 'foo' will be ignored only relative to the .gitignore file. I don't read anything explaining its recursive behavior. Shell globs (from what I read and experience) are not recursive. Now further below it explains the double asterisk: A