Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
6
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

posted at

updated at

WindowsにGitをインストールした後にやっておくべき設定

alias 登録

git config --global alias.st status
git config --global alias.df diff
git config --global alias.dft "difftool --dir-diff"
git config --global alias.co checkout
git config --global alias.cm commit
git config --global alias.br branch

外部Diff/Mergeツール設定

Winmergeをインストール
バックップフォルダを設定

  • c:\bakcup
  • c:\temp

Windows7、8環境では、.gitconfigはユーザディレクトリ直下に存在。

~/.gitconfig
[merge]
    tool = winmerge
[mergetool "winmerge"]
    path = \"C:\\Program Files\\WinMerge\\WinMergeU.exe\"
    cmd  = \"C:\\Program Files\\WinMerge\\WinMergeU.exe\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\"
 [diff]
    tool = winmerge
    guitool = winmerge
[difftool "winmerge"]
    path = \"C:\\Program Files\\WinMerge\\WinMergeU.exe\"
    cmd  = \"C:\\Program Files\\WinMerge\\WinMergeU.exe\" -e -ub -dl \"Base\" -dr \"Mine\" \"$LOCAL\" \"$REMOTE\"

Git Bash 外観の改善

  • Console2をインストール

    1. Settings→TabsにGitを追加
    2. ShellはGitBashのパラメータママ
    3. Startup dir を作業ディレクトリにする
    4. Settings→ConsoleでGit用の色を見やすく変更
    5. Settings→Appearance→でフォント名をMSゴシックに変更
    6. View→ConsoleWindow→プロパティでフォントをMSゴシックに変更
  • lsの文字化け対応
    alias ls='ls --show-control-chars'

  • git コマンドでの日本語ファイル名文字化け(数値コードになる)対応
    git config --global core.quotepath false

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
6
Help us understand the problem. What are the problem?