0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Git] 動作を試す 実行例15:configで設定して日本語ファイル名を表示する

Posted at

Gitの動作を理解するために、Gitのコマンドを実際に試して、結果を見てみました。

1つの記事内で一連のGitコマンドが完結しているので、これら一連のコマンドを順に実行させて結果を見ることで、一連のGitの動作を実際に体感でき、一通り独習することが可能です。

※前回記事のリポジトリ状態からの続きになっています。

前回記事へ 目次へ:Git関連記事のまとめページ 次回記事へ

実行例

echo Sample-Added-あいう●🔴 > testあいう●🔴.txt
git status
↓
結果: 
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        "test\343\201\202\343\201\204\343\201\206\342\227\217\360\237\224\264.txt"

※gitで日本語ファイル名を表示する
git config --global core.quotepath false

(※以降は内容確認用のコマンド実行)
git status
↓
結果: 
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        testあいう●🔴.txt

git add .
git diff --staged
↓
結果: 
diff --git a/testあいう●🔴.txt b/testあいう●🔴.txt
new file mode 100644
index 0000000..ee87692
--- /dev/null
+++ b/testあいう●🔴.txt
@@ -0,0 +1 @@
+Sample-Added-<82><A0><82><A2><82><A4><81><9C>??

git restore --staged .
git clean -f
↓
結果: 
Removing testあいう●🔴.txt

環境

Windows 10、PortableGit-2.40.0-64-bitを使用、全てローカルPC上で実施、GitHub等は不使用。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?