※ 参考
1.4 Gitによるバージョン管理
1.4 Gitによるバージョン管理
そもそもmacOSにGitって入ってる?
1 2 | (base) users -iMac:~ user$ git --version git version 2.20.1 |
■初回設定
自身の名前とメールアドレスを登録※以前、何か登録したようなので、上書きオプション"--replace-all" を付加して実行
※今回は勉強用なので、登録するユーザー名・メールアドレスは適当な名前
1 2 | (base) users -iMac:~ user$ git config --replace-all --global user.name "git user" (base) users -iMac:~ user$ git config --replace-all --global user.email user@user.com |
以前設定したコンフィグ値を確認するには "git config [名前]" (例:git config user.name) で確認できる。
■レポジトリ初期化
git init
environment/hello_appディレクトリに移動し git init を実行1 2 3 | (base) users -iMac:~ user$ cd ~ /environment/hello_app/ (base) users -iMac:hello_app user$ git init Initialized empty Git repository in /Users/user/environment/hello_app/ .git/ |
■プロジェクトのファイルをレポジトリに追加
ディレクトリ上のすべてのファイルを追加させたいので「-A」オプションを付け git add を実行git add -A
1 | (base) users -iMac:hello_app user$ git add -A |
[Ruby][Rails][macOS]
https://railstutorial.jp/chapters/beginning?version=5.1#sec-version_control
https://railstutorial.jp/chapters/beginning?version=5.1#sec-version_control
0 件のコメント:
コメントを投稿