git remote 简单用法 http://blog.csdn.net/xiruanliuwei/article/details/6919416

来源:互联网 发布:汽车模型设计软件 编辑:程序博客网 时间:2024/05/16 06:11
git remote 不带参数,列出已经存在的远程分支,例如:
#git remote
origin_apps

git remote -v | --verbose 列出详细信息,在每一个名字后面列出其远程url,例如:
#git remote -v
origin_apps     gitolite@scm:apps/Welcome.git (fetch)
origin_apps     gitolite@scm:apps/Welcome.git (push)
需要注意的是,如果有子命令,-v | --verbose需要放在git remote与子命令中间。

git remote add name url 在url创建名字为name的仓库(Adds a remote named <name> for the repository at <url>)name为远程仓库的名字

git remote add name url的解释有误,是为本地仓库创建一个指向远程仓库的链接一类的东西(remote),name是指这个链接的名字而不是远端仓库的名字,是可以任取的,一般用origin这个名字指向clone的源仓库(upstream repository)。


git remote show name 必须要带name,否则git remote show的作用就是git remote,给出remote name的信息。 
原创粉丝点击