这个问题基于Detach子目录到单独的Git存储库中
我想分离一对,而不是分离一个子目录.例如,我当前的目录树如下所示:
/apps
/AAA
/BBB
/CCC
/libs
/XXX
/YYY
/ZZZ
Run Code Online (Sandbox Code Playgroud)
而我想这样做:
/apps
/AAA
/libs
/XXX
Run Code Online (Sandbox Code Playgroud)
该--subdirectory-filter
参数git filter-branch
将无法工作,因为它在第一次运行时除去了给定目录之外的所有内容.我认为使用--index-filter
所有不需要的文件的参数会起作用(尽管很乏味),但如果我尝试不止一次运行它,我会得到以下消息:
Cannot create a new backup.
A previous backup already exists in refs/original/
Force overwriting the backup with -f
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?TIA
我现在遇到一个奇怪的问题,即一个存储NSDictionary
的NSUserDefaults
,然后取回其转换为一个NSCFString
.
这是我保存数据的地方:
- (void)saveProgress
{
// Save our progress to the user defaults.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSMutableDictionary *progressDict = [NSMutableDictionary dictionary];
if ([defaults objectForKey:@"session_progress"] != nil) {
[progressDict addEntriesFromDictionary:[defaults dictionaryForKey:@"session_progress"]];
}
NSMutableDictionary *targetsDict = [NSMutableDictionary dictionary];
if ([progressDict objectForKey:@"targets"] != nil) {
[targetsDict addEntriesFromDictionary:[progressDict objectForKey:@"targets"]];
}
NSMutableDictionary *trackableDict = [NSMutableDictionary dictionary];
if ([targetsDict objectForKey:@"mda_sao_ext_04"]) {
[trackableDict addEntriesFromDictionary:[targetsDict objectForKey:@"mda_sao_ext_04"]];
}
[trackableDict setObject:[NSNumber numberWithBool:YES]
forKey:@"viewed"];
NSLog(@"SAVE Trackable %@ %@", [trackableDict class], trackableDict);
[targetsDict setObject:trackableDict …
Run Code Online (Sandbox Code Playgroud)