git 操作

git切换ssh和http协议

  • 切换协议:
  1. 查看当前remote

    git remote -v

  2. 切换到http:

    git remote set-url https://github.com/username/repository.git

  3. 切换到ssh:
    git remote set-url [email protected]:username/repository.git

某些文件不想提交

# 执行命令将文件加入不提交队列

git update-index --assume-unchanged 你的文件路径

# 执行命令将文件取消加入不提交队列

git update-index --no-assume-unchanged 你的文件路径

你可能感兴趣的:(git)