GitHubでPersonal Access Tokenを発行します
https://docs.github.com/ja/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
SourceTree設定

アカウント設定からユーザ名、Personal Access Tokenを設定してください。
Terminal
$ vi ~/.gitconfig
[core]
excludesfile = /Users/{ユーザ名}/.gitignore_global
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[user]
name = {ユーザ名}
email = yuu@example.com
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[commit]
template = /Users/{ユーザ名}/.stCommitMsg
[credential]
helper = manager
[url "https://ghp_CH4 (略) jid:x-oauth-basic@github.com/"]
insteadOf = https://github.com/
MacのTerminalに設定します。ユーザ名と(略)としているPersonal Access Tokenは各自の値を入力します。 これでSource TreeからGitHubのリポジトリをFetchしたり、Pushできるようになります。



