[HOME]: [Mac OS X]: [MacPython]: [Emacs]: [生存報告記]:

Git

目次

概要

公式サイト

http://git-scm.com/

関連サイト

インストール

# Ubuntu
apt install git

# mac brew
brew install git

設定

設定ファイルの位置

以下等を読み込む 基本的には「.config」以下を利用した方が良い

コマンドで設定編集

git config で設定書き込みができる

$ git config --global user.name 'your name'
$ git config --global user.email you@example.com

上記のようにすると、configに以下のように書き込まれる

[user]
    name = your name
    email = you@example.com

設定確認

現状反映されている設定を確認するには以下のようにする

git config --global --list

利用方法

git tag

タグ一覧

git tag

タグ詳細

git show タグ名

現在の場所にタグ付与

git tag -a タグ名 -m 'タグコメント'

後から付与する場合

git tag -a タグ名 -m 'タグコメント' コミット名やbranch名

タグのpush

git push origin タグ名

submodule

追加

git submodule add https:...(等)

削除

追加したsubmoduleを削除する場合

git submodule deinit -f <submodule>
git rm -f <submodule>
rm -rf .git/modules/<submodule>

コマンド追加

git はコマンドを追加可能

gitflow

プラグイン

クライアントツール

CUI

Mac/Windows

Mac、windows両方で挙動するツールを利用するのが良いと思う

Emacs

自分はgit関連操作をほぼ全てmagitで実施してしまっている

参考サイト

A Visual Git Reference


CategoryProgramingTools