LoginSignup
0
0

More than 1 year has passed since last update.

Gitコマンド集

Last updated at Posted at 2023-02-27

ポートフォリオ作成のためにGitHubの使い方を再確認中なのですが、こんがらがってきたので少しまとめました。

  • ユーザー名、メールアドレス、デフォルトブランチ名を確認
$ cat ~/.gitconfig
[user]
        name = 〇〇
        email = myemail@example.com
[init]
        defaultBranch = main

アッドの取り消し(追跡していない状態に戻す)

$ git rm --cached ファイル名

直前のコミットの取り消し

$ git reset --soft HEAD^
  • リモート追跡ブランチの一覧
$ git branch -r
  origin/feature/202303/user
  origin/main
  • git init の取り消し
    git initしたディレクトリに対してそれを取り消す方法です。
    このコマンドによりディレクトリがgit管理下から外れ、.gitフォルダも消えます。
$ rm -rf .git

参考サイト

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