在java中声明类中的枚举时,我已经看到了这两种方法:
1)
public class MyClass {
private enum MyEnum {
A, B, C;
}
/* Static fields */
/* Instance variables */
/* Methods */
}
Run Code Online (Sandbox Code Playgroud)
2)
public class MyClass {
/* Static fields */
/* Instance variables */
/* Methods */
private enum MyEnum {
A, B, C;
}
}
Run Code Online (Sandbox Code Playgroud)
哪一个最常用?这有什么约定吗?
我有一个具有以下结构的git存储库:
.git/
project-root/
abc/
xyz/
Run Code Online (Sandbox Code Playgroud)
这就是我想要的:
project-root/
.git
abc/
xyz/
Run Code Online (Sandbox Code Playgroud)
我一直在研究如何实现这一目标,这是我迄今为止所发现的:http://git-scm.com/docs/git-filter-branch
根据这个,我应该通过以下命令实现我想要的:
git filter-branch --subdirectory-filter project-root -- --all
Run Code Online (Sandbox Code Playgroud)
这会重写提交历史记录,但大多数非快进合并提交都会丢失(请参见下图).
有没有办法保留这些提交?
