Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 1.17 KB

git_remote.md

File metadata and controls

29 lines (20 loc) · 1.17 KB

git remote 指令

参考资料:

git remote 常用指令:

  • git remote rm origin

  • git remote remove origin

    • 删除本地仓库指向的远程仓库
  • git remote add origin https://github.com/csss/test

  • git remote -v

    • 查看远程服务器地址和仓库名称
  • git remote show origin

    • 查看远程服务器仓库状态(显示线上有哪些分支以及哪些分支已关联,本地有哪些分支)
  • git remote add origin https://github.com/csss/test

    • 添加远程仓库地址(将本地仓库与远程仓库建立关联)
  • git remote set-url origin https://github.com/csss/test

    • 设置远程仓库地址(用于修改本地仓库关联的远程仓库地址)
    • 常用于切换git协议: 例如原来使用SSH协议方式无法提交代码了,可使用该指令将远程仓库地址换成http协议的地址:git remote set-url origin [http的url]

相关指令:

  • git config 配置文件指令:这个指令, 我小弟!