我们有一个本地 git 服务器,带有 LFS 文件。我们计划将所有内容迁移到 MS Azure DevOps 上。经过一些研究,我读到建议进行“镜像”克隆,以拥有所有内容(至少是标签):
git 克隆 --mirror
然后,由于我有一些 LFS 文件,我也想获取它们:
git lfs fetch --all
但我收到这个错误:
Error: Failed to call git rev-parse --git-dir --show-toplevel: "fatal: this operation must be run in a work tree\n"
Not in a git repository.
Run Code Online (Sandbox Code Playgroud)
对于我正在阅读的内容, git lfs fetch 在存储库上不起作用bare(并不是说我知道这是什么,但我认为它与该--mirror选项有关。
所以我的问题是:我应该怎么做才能将所有内容转移到这个新存储库?(此后本地服务器将关闭)。
谢谢
我刚刚设置了一个带有 NGXS 的 Angular 项目。
在我的 AuthState 中,我有以下内容:
@Injectable()
export class AuthState {
@Selector()
static isAuthenticated(state: AuthStateModel) {
return state.currentUser !== null;
}
//...
}
Run Code Online (Sandbox Code Playgroud)
在组件中,我正在执行以下操作:
export class HeaderComponent implements OnInit {
@Select(AuthState.isAuthenticated) isAuthenticated$: Observable<boolean>;
//...
}
Run Code Online (Sandbox Code Playgroud)
但它给了我一个编译错误:
src/app/layout/header/header.component.ts:14:38 - error TS2564: Property 'isAuthenticated$' has no initializer and is not definitely assigned in the constructor.
14 @Select(AuthState.isAuthenticated) isAuthenticated$: Observable<boolean>;
~~~~~~~~~~~~~~~~
Run Code Online (Sandbox Code Playgroud)
我完全理解为什么在这里,角度无法知道它将被正确初始化。
我搜索了一下,发现很多链接指向禁用属性初始化检查
"strictPropertyInitialization": false
Run Code Online (Sandbox Code Playgroud)
在 tsconfig.json 中
但问题是我喜欢这个检查,我不想禁用它。必须有一种方法可以不为整个应用程序禁用此功能,但仍然使用 NGXS Select,对吗?
我正在尝试使用PrimeNg Toasts来确认删除一个用户。
基本上,这是我的代码:
deleteUser() {
this.confirmationService.confirm({
message: this.translateService.instant('common.messages.deletion-confirm'),
header: this.translateService.instant('common.messages.deletion-title'),
icon: 'fa-light fa-triangle-exclamation',
acceptLabel: this.translateService.instant('common.messages.ok'),
rejectLabel: this.translateService.instant('common.messages.cancel'),
rejectButtonStyleClass: 'p-button-secondary p-button-text',
accept: async () => {
await this.userSettingsService.deleteUser(this.store.selectSnapshot(state => state.userSettings.activeUser.id));
this.messageService.add({ severity: 'success', summary: 'User deleted', detail: 'User deleted successfully' });
},
});
}
Run Code Online (Sandbox Code Playgroud)
如果成功,将userSettingsService调用后端并要求更改路线(转到用户列表)。
根据我的测试,messageService仅尝试在当前组件中显示toast,如果我在父组件中设置组件(例如我的布局组件),则它不会显示。
由于我正在从用户页面转换到用户列表页面,因此我不确定如何设置<p-toast>. 我尝试过:
但什么也没有显示。任何想法?
我想知道是否存在可以管理某些"任务"的现有框架.
我知道任务并行,但(如果我错了,请纠正我)我不认为它符合我的需要(主要是因为它适用于完成的任务列表).
我需要的基础是我想给X线程做一些工作.
但是:
你知道什么可以帮助我吗?或者我应该用手管理一切?
我有一个Covariant接口,它位于其父类型的数组中。它们是这样全局定义的:
//The interface/class
public interface IMyType<out T>{}
public class MyType<T>: IMyType<T>{
T value;
MyType<T>(T initialValue){
value = initialValue;
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试了这个:
IMyType< object>[] tt = new IMyType<object>[]
{
new MyType<String>( "test"), //Works fine
new MyType<SomeOtherRandomClass>(new SomeOtherRandomClass()),//works fine
new MyType<Int32>(12)//Doesn't work
};
Run Code Online (Sandbox Code Playgroud)
甚至尝试指定结构而不是对象:
IMyType< struct>[] tt = new IMyType<struct>[]//Doesn't work:Incorrect Number of parameter
{
new MyType<Int32>(12)//Doesn't work
};
Run Code Online (Sandbox Code Playgroud)
仅指定特定的结构有效:
IMyType< int>[] tt = new IMyType<int>[]//Does work
{
new MyType<Int32>(12)//Does work
};
Run Code Online (Sandbox Code Playgroud)
那么为什么这不起作用呢?有办法使它起作用吗?
我的窗口在两个应用程序之间应该是相同的,除了某些点之外。我想继承它来创建一个子类(没有 XAML),它只在构造函数中进行一些自定义(如窗口的标题)。
这可能吗?
angular ×2
c# ×2
.net ×1
azure-devops ×1
covariance ×1
generics ×1
git ×1
git-lfs ×1
inheritance ×1
ngxs ×1
primeng ×1
struct ×1
toast ×1
typescript ×1
wpf ×1
xaml ×1