1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

IBM i でGitコード管理:02:ローカルリポジトリの作成と操作

Last updated at Posted at 2025-01-21

01:Gitの基礎の続きです。

Gitロカールリポジトリーの作成から基本操作について

Git ロカールリポジトリを作成する

以下のコマンドを実行するとそのディレクトリーにGitのローカルリポジトリーが作成されます。

git init

確認してみます。
まず、素のディレクトリーを作ります。

md git_goma

状態は、、このようにフォルダーは空です。(隠しファイル表示オンにしています)
image.png

次にGit ローカルリポジトリーを作成

git init

Initialized empty Git repository in D:/git_goma/.git/ というメッセージが出て、
image.png

※おっとここで、Gitクライアントでなくwindowsコマンドプロンプトだったことが判明(^^;問題なさそうなのでこのまま続けます。
ディレクトリーに 隠しフォルダー .git が作成されます
image.png

.gitフォルダーの中は・・
image.png

このフォルダー(=Gitのワークツリーと同義(?))にファイルを置くとGit管理下に置かれる。直後はuntrackedのステータスになる。

ファイルごとのステータスは、

git status

で確認できます。
image.png
上記で作成したファイルが Untrackedなのが分かります。

※書き方記事は参考の章に記載しました。

Gitクライアントで見ると、フォルダーが (maser)と表示されます。
image.png

Git管理にしたくないファイルがある場合、.gitignore ファイルを作成しファイル名を記述する。

※書き方記事は参考の章に記載しました。

すてきな記事たち

下記記事を参考にさせていただいてます。感謝♪

[Git] .gitignoreの仕様詳解
Git 2.18頃の記事のようですが基本はあまり変わっていないでしょう・・

Gitで現在の状態や変更箇所を確認する方法(diff,log)+.gitignoreについて

・・・続く

1
1
2

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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?