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

git init を取り消す(git bash)

Posted at

間違ってホームディレクトリ(~)で git init を実行してしまい、Git の管理を取り消したい場合の手順です。

1. ホームディレクトリに移動します
cd ~

2. .git ディレクトリを削除します
rm -rf .git

  • rm コマンドはファイルを削除するために使用します
  • -r オプションはディレクトリとその中身を再帰的に削除します
  • -f オプションは確認なしで強制的に削除します

注意
ディレクトリを間違えると、重要なファイルも消えてしまうため、コマンド 実行前に必ず実行するディレクトリを再確認してください。

3. .git ディレクトリがなくなっていることを確認します
ls -a
実行結果に .git という名前のディレクトリが表示されなければ、削除は成功しています。

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