git remote
2014-02-24 16:00
281 查看
在git里,服务器上的仓库在本地称之为
直接
另外一种
把工作目录迁移到github上面:
显示所有的远程仓库
重命名远程仓库
删除远程仓库
从远程仓库抓取数据,更新本地仓库:
查看远程仓库信息,可用于跟踪别人的
remote。
直接
clone一个仓库:
$: git clone git@search.ued.taobao.net:projects/search.git
另外一种
clone方式:
# 创建目录初始化本地仓库 $: mkdir search && cd search $: git init # 添加远程仓库路径 $: git remote add github git@github.com:yyfrankyy/search.git # 实际上,pull 就是 fetch + merge $: git pull github --all --tags
把工作目录迁移到github上面:
$: git remote add github git@github.com:yyfrankyy/search.git $: git push github --all --tags
显示所有的远程仓库
$: git remote -v origin git@search.ued.taobao.net:projects/search.git (fetch) origin git@search.ued.taobao.net:projects/search.git (push) github git@github.com:yyfrankyy/search.git (fetch) github git@github.com:yyfrankyy/search.git (push)
重命名远程仓库
$: git remote rename github gh $: git remote origin gh
删除远程仓库
$: git remote rm github $: git remote origin
从远程仓库抓取数据,更新本地仓库:
$: git fetch origin remote: Counting objects: 58, done. remote: Compressing objects: 100% (41/41), done. remote: Total 44 (delta 24), reused 1 (delta 0) Unpacking objects: 100% (44/44), done. From git://search.ued.taobao.net:projects/search.git * [new branch] product -> origin/product
查看远程仓库信息,可用于跟踪别人的
push:
$: git remote show origin * remote origin Fetch URL: git@search.ued.taobao.net:projects/search.git Push URL: git@search.ued.taobao.net:projects/search.git HEAD branch: master Remote branches: master tracked p4popt tracked prepub tracked product tracked Local branches configured for 'git pull': master merges with remote master p4popt merges with remote p4popt prepub merges with remote prepub product merges with remote product Local refs configured for 'git push': master pushes to master (up to date) p4popt pushes to p4popt (up to date) prepub pushes to prepub (up to date) product pushes to product (up to date)
相关文章推荐
- STM32F10X_XX宏定义的选择
- Ubuntu上搭建Hadoop环境(单机模式+伪分布模式)
- Sqoop安装及操作以及oozie&sqoop
- Dynamics CRM 2013 Message List
- linux之awk命令获取最后一列
- 职场工作中我们必须要学会的两种能力
- JAVA简单自定义类实现与测试
- Feature Catalyst 2960 with LAN Base Catalyst 2960 with LAN Lite
- Android 刷机过程
- Cocos2dx 创建屏蔽层 2.x
- ECM: The inventory location file for the special Windows NT case does not exist or is unreadable
- Linux Containers 分享大纲
- Java策略模式的简单应用实现方法
- springMVC系列源码之配置文件深入——11
- 枚举(1111)
- Shiro-1.2.2内置的FilterChain
- NSRunLoop 详细解释
- ios中单例模式的一点理解
- awk调用shell命令的两种方法:system与print
- pthread_detach