%USERPROFILE%
で、/mnt/c/Users/(ユーザ名)
が開かれる\\wsl$\Ubuntu-18.04\home\(ユーザ名)
で設定できる/home/(ユーザ名)
のようなLinuxのパスでは正しく動作しない$ sudo apt -y update $ sudo apt -y upgrade
$ sudo apt -y install language-pack-ja
.ssh
ディレクトリは初期では存在しない# ディレクトリの作成 $ mkdir ~/.ssh # パーミッションの変更 $ chmod 700 ~/.ssh
.ssh
直下にconfigファイルを作成するServerAliveInterval 60 Host github github.com HostName github.com User git IdentityFile /home/(ユーザ名)/.ssh/github/id_rsa
$ ssh -T github Hi (ユーザ名)! You've successfully authenticated, but GitHub does not provide shell access.
if [ -z "$SSH_AUTH_SOCK" ]; then # Check for a currently running instance of the agent RUNNING_AGENT="`ps -ax | grep 'ssh-agent -s' | grep -v grep | wc -l | tr -d '[:space:]'`" if [ "$RUNNING_AGENT" = "0" ]; then # Launch a new instance of the agent ssh-agent -s &> .ssh/ssh-agent fi eval `cat $HOME/.ssh/ssh-agent` fi ssh-add $HOME/.ssh/github/id_rsa
# 名前とメールの設定 $ git config --global user.email "you@example.com" $ git config --global user.name "Your Name" # 自動改行変換の無効化 $ git config --global core.autoCRLF false
sudo chmod -R 777 .
をよく実行する# パーミッション変更の無効化(initやcloneの都度実行) $ git config core.filemode false
git branch
などで確認する必要がある~/.bashrc
の末尾に下記を追加するexport PS1='\[\033[01;32m\]\u@\h\[\033[01;33m\] \w \[\033[01;31m\]$(__git_ps1 "(%s)") \n\[\033[01;34m\]\$\[\033[00m\] '