LoginSignup
1
0

More than 1 year has passed since last update.

gitの初期化コマンド(初学者)

Last updated at Posted at 2022-03-09

git1.png
まずは、GitHubに登録してアカウントを取得します。マニュアルに従ってNew repositoryCreate repositoryで作成してセットアップ画面でHTTPSから始まる文字列をコピーしてターミナルに以下のコマンドを入れて貼り付け実行。
git2.png
git3.png
git4.png

git clone https://github.com/user_name/hoge.git

入力しましたがリポジトリが空なので持ってくるものが何も無いエラー表示。

Cloning into ‘hoge’...
warning: You appear to have cloned an empty repository.

すかさず

git ststus

で状況を把握するも、

fatal: not a git repository (or any of the parent directories): .git

ディレクトリが違うようなことを言ってくる始末。。。こんな時に使うコマンドが

git init

です。

Initialized empty Git repository in /Users/name/Desktop/hoge/.git/

空のリポジトリが無事初期化されました。

1
0
1

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
1
0