1. 生成 token
  2. git pul 拉代码,输入账号username,密码password用 token
  3. 设置缓存避免每次输入
# 默认缓存15分钟((默认是 “900”,也就是 15 分钟))
git config --global credential.helper cache

# 自定义缓存一个小时
git config --global credential.helper 'cache --timeout=3600'

# 长期缓存
git config -global credential.helper store

# 取消缓存可以使用
git config --global --unset credential.helper

Git - 凭证存储