gitignore

Ignore folder in stable, but not in devel branch

一笑奈何 提交于 2020-01-13 17:09:52
问题 I have the following folder structure for my project src/ test_unit/ package1/ test_unit/ package2/ test_unit output/ In my devel branch all folders should be version controlled, but the master/stable branch should ignore and not merge test_unit/ and output/ folder. How can I achieve this? With .gitignore it won't work because .gitignore will be merged between the branches. 回答1: Try a combination of .gitignore and .gitattributes files: in master/stable branch, you could have .gitattributes

Ignore folder in stable, but not in devel branch

我与影子孤独终老i 提交于 2020-01-13 17:08:12
问题 I have the following folder structure for my project src/ test_unit/ package1/ test_unit/ package2/ test_unit output/ In my devel branch all folders should be version controlled, but the master/stable branch should ignore and not merge test_unit/ and output/ folder. How can I achieve this? With .gitignore it won't work because .gitignore will be merged between the branches. 回答1: Try a combination of .gitignore and .gitattributes files: in master/stable branch, you could have .gitattributes

.gitignore NuGet packages folder at any level but include .targets file at any level

送分小仙女□ 提交于 2020-01-12 07:15:10
问题 I'm trying to implement the workaround for the NuGet Package Restore Issues. This involves ignoring the contents of all packages folders, at any level in the hierarchy. However, .targets files (typically in subfolders of packages folders) should not be ignored. For example: .gitignore YourProject/ YourProject.csproj packages/ repositories.config Microsoft.Bcl.Build.1.0.7/ lib/ foo.dll tools/ Microsoft.Bcl.Build.targets Should include only files: .gitignore YourProject.csproj Microsoft.Bcl

Which file does svn:ignore modify?

筅森魡賤 提交于 2020-01-11 10:57:23
问题 I would like to know which file svn propset svn:ignore modifies (equivalent to .gitignore ) so that I can actually commit that file to the repo. E.g. I am working with Java and Maven , which creates a directory named "target", which I am ignoring. svn propset svn:ignore target . does work but I don't know which settings file is modifies by that command so that I propagate the change to my team. RELATED: SVN ignore like .gitignore 回答1: svn:ignore property is stored together with other

Git ignore & changing the past

做~自己de王妃 提交于 2020-01-10 01:40:09
问题 I only recently added a .gitignore file to ignore some specific data files in a subdirectory of mine. I'd really like to go back in time and remove them from previous commits/history as well. Is this easily accomplished? Where/how should I start? 回答1: This will be a two-step procedure: Introduce the .gitignore file For this to work, the early commits are going to have to have your .gitignore file. So, you need to: Check out the root commit: git checkout -b temp $(git rev-list HEAD | tail -1)

Force add despite the .gitignore file

若如初见. 提交于 2020-01-08 18:16:33
问题 Is there a way to force git to add a file despite the .gitignore file? 回答1: See man git-add: -f, --force Allow adding otherwise ignored files. So run this git add --force my/ignore/file.foo 回答2: Despite Daniel Böhmer's working solution, Ohad Schneider offered a better solution in a comment: If the file is usually ignored, and you force adding it - it can be accidentally ignored again in the future (like when the file is deleted, then a commit is made and the file is re-created. You should

Using Xcode preferences vs .gitignore file

时光怂恿深爱的人放手 提交于 2020-01-06 05:48:27
问题 I'm new to git repositories and have found lots of great support for creating a .gitignore file that I would put in each project directory. However, I've noticed that in Xcode 10 preferences under Source Control under the git tab there is a spot to specify files to ignore. Is there an advantage to defining the exclusions in Xcode versus the .gitignore file? I can't seem to find anyone that actually does it this way and Apple docs are light. Are there some items (maybe globals) that I would

.gitignore not ignoring filenames with spaces in them on `git status`

我怕爱的太早我们不能终老 提交于 2020-01-05 09:05:41
问题 When I do a git status I get: # modified: COM/config/Config/Edit Project Settings.lnk But in my .gitignore I have: *.lnk What is going on here? Could it be a problem with whitespaces? 回答1: The problem is not with the whitespaces. I think the file is already tracked in your git repo, so you can remove it from the repo using the following: git rm -r --cached "COM/config/Config/Edit Project Settings.lnk" git commit -m "removed .lnk" This won't delete the .lnk file, only untrack it locally

Keep a different configuration file (untracked) for each branch

我怕爱的太早我们不能终老 提交于 2020-01-03 17:23:23
问题 In a git repository I have two files: config/conf.yaml.sample (which is tracked by git, but it's ignored when my program is launched) and a copy of it called config/conf.yaml (which is ignored by git, but it's read when my program is launched). When I switch from branch A to branch B I always have the same configuration file (because config/conf.yaml is untracked) and that means, for example, that each branch relates to the same database, same ports, and so on. I want to keep a different

Why is .gitignore not including a file prefixed by a !

谁说我不能喝 提交于 2020-01-03 09:38:17
问题 My .gitignore file reads as follows: build/ glucosia.xcodeproj/ !glucosia.xcodeproj/project.pbxproj core-plot/framework/build core-plot/framework/CorePlot-CocoaTouch.xcodeproj/ !core-plot/framework/CorePlot-CocoaTouch.xcodeproj/project.pbxproj .DS_Store Classes/.DS_Store Strangely, glucosia.xcodeproj/project.pbxproj is not ignored, as I would expect. But, core-plot/framework/CorePlot-CocoaTouch.xcodeproj/project.pbxproj is still being ignored. Any ideas? Thanks! 回答1: As mentioned in the