7远程操作

远程操作

1.查看已配置的仓库

命令
git remote -v	//查看已配置的仓库

2.添加远程仓库

命令
git remote add <sname> <url>	
//参数:标识仓库名与其地址

3.重命名远程仓库

命令
git remote rename <oname> <nname>
//参数:旧名 新名

4.查看远程仓库

命令
git remote show <sname>
//参数:仓库名

5.推送内容

命令
git push <remote> <branch>
//参数:仓库名 分支名

6.拉取内容

命令
git fetch <remote>//抓取远程仓库,不影响工作目录
git pull <remote> <branch> //抓取远程仓库,并放入工作目录
//参数:仓库名 分支名

7.移除远程仓库

命令
git remote remove <sname>
//参数:仓库名