.gitgnore文件,但不在特定目录下

时间:2017-12-22 20:37:52

标签: git gitignore

我有一个Java项目,我忽略了所有带有 .gitignore 模式的jar文件:

*.jar

但是,文件夹 dependencies 中有依赖项文件,这些文件是jar文件,但我不想排除它们。 如何为此设置 .gitignore

1 个答案:

答案 0 :(得分:1)

您可以使用否定模式来包含先前模式忽略的文件:

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

CustomTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
Journal* journal = [self.fetchedResultsController objectAtIndexPath:indexPath];

cell.titleLabel.text = journal.title.uppercaseString;
cell.titleLabel.font = [UIFont fontWithName:@"SourceSansPro-Bold" size:25];
cell.titleLabel.textColor = [UIColor blackColor];

cell.detailLabel.text = journal.detail;
cell.detailLabel.font = [UIFont fontWithName:@"SourceSansPro-SemiBold" size:18];
cell.detailLabel.textColor = [UIColor blackColor];

NSDate *currentDate = journal.timeStamp;

cell.dateLabel.text = [self.dateFormatter stringFromDate: currentDate];
cell.dateLabel.font = [UIFont fontWithName:@"SourceSansPro-SemiBold" size:16];
cell.dateLabel.textColor = [UIColor blackColor];

cell.locationLabel.text = [NSString stringWithFormat:@"%@, %@", journal.city, journal.country];
cell.locationLabel.font = [UIFont fontWithName:@"SourceSansPro-SemiBold" size:18];
cell.locationLabel.textColor = [UIColor blackColor];

cell.tempLabel.text = [NSString stringWithFormat:@"%g°C", round(journal.temp)];
cell.tempLabel.font = [UIFont fontWithName:@"SourceSansPro-SemiBold" size:18];
cell.tempLabel.textColor = [UIColor blackColor];
cell.weatherIcon.image = [UIImage imageNamed:journal.condition];

cell.backgroundView = [[UIImageView alloc] initWithImage:[ [UIImage imageWithData:journal.image] stretchableImageWithLeftCapWidth:0.0 topCapHeight:5.0] ];
cell.backgroundView.contentMode = UIViewContentModeScaleAspectFill;
cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:[ [UIImage imageWithData:journal.image] stretchableImageWithLeftCapWidth:0.0 topCapHeight:5.0] ];
cell.selectedBackgroundView.contentMode = UIViewContentModeScaleAspectFill;
cell.backgroundView.alpha = 0.5;
cell.selectedBackgroundView.alpha = 0.5;

return cell;
}