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

まず覚えるべきgitコマンドまとめ

Last updated at Posted at 2019-09-10

自分用にメモ。
前提条件として、gitがインストールされている事とgithubに登録されている事。

初期設定で使うgitコマンド

ユーザー名登録  git config --global user.name "githubユーザ名"

メールアドレス登録  git config --global user.email "github登録メアド"

使うエディタ設定  git config --global core.editor "使ってるエディタ名"

設定確認 git config --list

開発中使用gitコマンド

基本的に作業ディレクトリにて使用

ローカルリポジトリ作成  git init

Gitリポジトリのコピー git clone リポジトリURL

変更を全てステージに追加  git add .

変更を記録 git commit

変更状況を確認 git status

リモートリポジトリ作成 git remote add origin 追加したいリポジトリ

リモートリポジトリへ送信 git push origin master

さらに先へ

通常の開発ではブランチを分けて、主にmasterブランチをリリース用として使用する。

新しいブランチを作成  git branch ブランチ名

ブランチの一覧表示 git branch -a

ブランチの切り替え  git checkout 切り替えたいブランチ名

また他の人の変更を取り込むことを「マージ」と呼び、複数人で開発するときは必須のスキルになっている

作業中のブランチにマージ  git merge ブランチ名

ただしここら辺は少し複雑なので、引き続き勉強が必要。

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?