git restoreってなんだ

不適切なファイルをgit addしてしまいました weblog % git add content/posts/git-restore.md weblog % git status On branch main Your branch is up to date with 'origin/main'. Changes to be committed: (use "git restore --staged <file>..." to unstage) new file: content/posts/git-restore.md こういった場合 git reset <FILE>を使ってunstagedにしていました が、上の例にもあるけど、git restoreを使えというサジェストが出ています そもそも気がついたときのログにはadd/rmのサジェストも出ています Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) git add/rm: commitされた内容を更新する git restore: working directoryの内容を破棄する という違いがあるようです 今回のように間違ってaddしてしまった場合は、git restoreの方が正しそうです。 試してみます。 ...

January 8, 2021 · 1 min · motoki yoan

もともとJavaプロジェクトでKotlinをインポートさせたい

やりたいこと JavaのプロジェクトにKotlinを入れたい 発生した状況 build.gradleの差分 diff --git a/build.gradle b/build.gradle index xxxxxxxxxx..xxxxxxxx --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,7 @@ plugins { id '...' id '...' id '...' + id 'org.jetbrains.kotlin.jvm' version '1.4.10' } + +compileKotlin { + kotlinOptions.jvmTarget = '1.8' +} エラー (正確にはSuccessを返しているが、buildで失敗する) > Task :prepareKotlinBuildScriptModel UP-TO-DATE <ij_msg_gr>JEE project import errors<ij_msg_gr><ij_nav>/path/to/project/build.gradle<ij_nav><i><b>root project 'example': Web Facets/Artifacts will not be configured properly</b><eol>Details: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':runtimeClasspath'.<eol>Caused by: org.gradle.internal.locking.LockOutOfDateException: Resolved 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10' which is not part of the dependency lock state</i> Could not resolve: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10 Could not resolve: org.jetbrains.kotlin:kotlin-stdlib:1.4.10 Could not resolve: org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10 Could not resolve: org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10 Could not resolve: org.jetbrains:annotations:13.0 KotlinDslScriptsParameter(correlationId=176802187286571, scriptFiles=[]) => StandardKotlinDslScriptsModel(scripts=[], commonModel=CommonKotlinDslScriptModel(classPath=[], sourcePath=[], implicitImports=[]), dehydratedScriptModels={}) - took 0.0 secs Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings BUILD SUCCESSFUL in 1s エラーの意味がよくわからずドハマリ…(Facets??, Artifacts??) ...

January 8, 2021 · 2 min · motoki yoan

ブログのテーマが決まらない

hugoを始めた ブログにあうテーマをここから探しているがいいのが見つからない だんだんと発散してきたので、シンプルで素敵なnoteworthyを使わさせていただきます ここではどんなテーマが良いかを整理する 必須 シンプル twitter, githubのリンクがある トップページに記事の一覧がある 画像をアップロードしやすい syntax highlightがついている あると嬉しい cssのカスタムが容易 目次やtagページを自動生成してくれる 毎年ブログ作っているけれど今年は続くのか…

January 1, 2021 · 1 min · motoki yoan