Git-远程仓库的使用

查看远程仓库

git remote:查看已经配置的远程仓库服务器

如果你已经克隆了自己饿仓库,那么至少应该能看到origin

添加指定选项-v,会显示需要读写远程仓库使用的Git保存的简写URL

git remote -v

origin https://github.com/schacon/ticgit(fetch)

origin https://github.com/schacon/ticgit(push)

添加远程仓库

git remote add <shortname> <url>

从远程仓库中抓取与拉取

git fetch [remote-name]

这个命令会访问远程仓库,从中拉取所有你还没有的数据。

推送到远程仓库

git push origin master

查看某个远程仓库

git remote show origin

远程仓库的移除与重命名

将pb重命名为paul,可以用git remote rename:

git remote rename pb paul

git remote 

git remote rm paul

git remote 

猜你喜欢

转载自www.cnblogs.com/zhichun/p/11755157.html