LoginSignup
0
0

gitエラー No such file or directory Vue.js 超入門 3.2対応 (技術の泉シリーズ(NextPublishing))

Last updated at Posted at 2023-09-15

使用した書籍

Vue.js 超入門 3.2対応 (技術の泉シリーズ(NextPublishing))

動作環境

Windows 10
git version 2.42.0.windows.2

はじめに

今回、こちらの書籍を使用した背景としてVue3に対応した書籍がまだまだ少ない中、kindleUnlimitedで読めるとの事だったので手を出してみました。
その中で、自分みたいに経験が浅い人が読むと誤解しそうな表現があったので備忘録として残すことにしました。

(書籍の序盤でも書かれていますが、完全な初心者向けの本ではない為、この本の内容を理解するにはある程度javascriptの知識が必要です。)

該当箇所

第3章 3.2 「ソースを連携する」のターミナルにコマンド入力する下記の箇所

$git init
$git add .
$git commit -m "first commit"
$git branch -M main
$git remote add origin git@github.com:< リポジトリー名 >/my-vite-todo.git
$git push -u origin main

gitエラーの内容

$ git remote add origin git@github.com:<my-vite-todo>/my-vite-todo.git
bash: my-vite-todo: No such file or directory

そんなファイルとディレクトリは存在しないといわれます。

原因

$ git remote add origin git@github.com:<my-vite-todo>/my-vite-todo.git

ここの記載方法が罠でoriginから後ろの表現
... origin git@github.com:< my-vite-todo >/my-vite-todo.git

ここの "git@github.com:< リポジトリー名 >" をそのまま鵜呑みにして
git@github.com:<my-vite-todo>
こんな記述をしていたことが原因でした。

解決方法

$ git remote add origin git@github.com:<my-vite-todo>/my-vite-todo.git
↓
$ git remote add origin git@github.com:gitのユーザ名/my-vite-todo.git

上記の通りに"git@github.com:ユーザ名/my-vite-todo.git"としてあげるとうまくいきます。

参考リンク

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0