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 3 years have passed since last update.

【Git】バージョン管理をする理由

Last updated at Posted at 2021-02-07

バージョン管理を行わなければアプリケーションが動かないというわけではないですが、
バージョン管理をしておけば、コードの履歴を追ったり、削除してしまったファイルを復旧できたりします。

【コマンド】

【変更のあった全てのファイルを追加】

git add -A

このコマンドを実行すると、現在のディレクトリにあるファイルが全て追加される.
.gitignoreに記載されているパターンにファイル名が合致するファイルは追加されない。

【削除】

rm -rf

rmは対象のファイルを削除するコマンド

-rf =
(recursive)
サブディレクトリやその中のファイルも全て削除する

(force)
削除して良いかどうかを確認しない
を指定するオプション

【復旧】

git checkout -f

削除前のディレクトリとファイルを復旧する

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?