LoginSignup
0
1

More than 5 years have passed since last update.

よく使うgitコマンドとエイリアスの設定

Last updated at Posted at 2017-12-27
プロジェクトをリモートリポジトリのブランチに上げる
$ git push

プロジェクトをリモートリポジトリのブランチから引っ張ってくる
$ git pull

プロジェクトをステージングエリアに上げる
$ git add *

プロジェクトをローカルリポジトリのブランチに上げる
$ git commit

変更とコミット
$ git commit -a

ブランチ切り替え
$ git checkout *

ブランチの一覧と現在のブランチ
$ git branch

2つのブランチを合致させる
$ git merge *

新たなブランチの作成
$ git branch *

ブランチの削除
$ git branch -d *

新たなブランチの作成+ブランチを切り替え
$ git checkout -b *

変更の一時退避
$ git stash

一時退避した変更を反映
$ git stash pop

一時退避した変更の履歴
$ git stash list

基本的なコマンドを覚えたら
git checkout *
とか
git branch
とか
よく使うのに長ったらしいのでエイリアスを設定しておく
~/.gitconfig
に直接書くか
$ git config --global alias.c checkout
 リポジトリ単位で設定したいときは
$ git config --local alias.b branch

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