LoginSignup
0
0

More than 3 years have passed since last update.

Gitコマンド一覧

Posted at

Linuxの基本コマンド一覧表

自身の備忘録の為に、Linuxコマンドの一覧表を作成しておきます。

環境:Git CMD

現在のパスを表示

pwd

ファイルのテキストを記載する

echo "記載内容" > ファイル名
//GitHubの設定
//メールが登録されているか確認する
$git config --global user.email

//Githubにメールアドレスを追加する
$git config --global user.email "email@excample.com"

//ローカルリポジトリを作成するためのコマンド
$ git init
Initialized empty Git repository in /Desktop/works/.git/

//指定したディレクトリにローカルリポジトリを作成
$ git init Desktop/works

//ディレクトリやインデックスの状態を確認するコマンド(ファイルがどのエリアに存在するのかを確認する。)
$ git status

//git status下記内容が表示される場合
//
On branch master
No commits yet
nothing to commit (create/copy files and use "git add" to track)

//GitHubにあるリポジトリをリモートリポジトリとして設定
$ git remote add origin https://github.com/M(自分のアカウント名)/(自分のプロジェクト名)

//コミットログの確認
$ git log

//リモートリポジトリをローカル(自分のPC)へクローンする
$ git clone https://github.com/masaki/example.git

//ファイルをステージングエリアに登録する
$ git add

//gitディレクトリに登録する
$git commit

//変更した内容を他のリポジトリに反映させる(2020/10以前はmain ⇒ master)。
$git push origin main

//ブランチ名を確認
$git branch

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