MacOs, LinuxでのGitコマンド
-
gitのバージョンをチェック
$ git --version
-
gitのユーザー設定
$ git config --global user.name "[ユーザー名]" $ git config --global user.email "[アドレス]"
-
gitの出力をカラーリング
$ git config --global color.ui auto
-
gitコマンドのエイリアスを設定
$ git config --global alias.[エイリアス] [コマンド]
-
ローカルリポジトリの作成
$ git init
ファイルの変更をコミットする
$ git add [ファイル名]
$ git commit -m "[コミットメッセージ]"
# インデックスのバリエーション
$ git add . # gitが管理する全てのファイルをインデックス
$ git add -u # 最新のコミットから変更があったもの全てインデックス
- 現在のブランチとインデックスの状態を確認
$ git status
# 現在のブランチを表示
On branch master
# インデックスしていない変更がある場合
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)
modified: sample.txt
no changes added to commit (use "git add" and/or "git commit -a")
# インデックスしているがコミットしていない変更がある場合
Changes to be committed:
(use "git rm --cached ..." to unstage)
new file: sample.txt
# 最新のコミット以後変更がない場合
nothing to commit, working directory clean
- ファイルの編集履歴を確認
$ git log
- リモートリポジトリをローカル環境にクローン
$ git clone [リモートリポジトリのURL] [ディレクトリ名]
- リモートリポジトリからローカルにプル
$ git pull orgin master
Author And Source
この問題について(MacOs, LinuxでのGitコマンド), 我々は、より多くの情報をここで見つけました https://qiita.com/vuntunan/items/53932a370911098570a1著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .