git remote
来源:互联网 发布:学通网络红尘老师QQ 编辑:程序博客网 时间:2024/05/30 02:25
git remote
- git remote
- 基本使用
基本使用
git是一个分布式代码管理工具,所以可以支持多个仓库,在git里,服务器上的仓库在本地称之为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 -vorigingit@search.ued.taobao.net:projects/search.git (fetch)origingit@search.ued.taobao.net:projects/search.git (push)githubgit@github.com:yyfrankyy/search.git (fetch)githubgit@github.com:yyfrankyy/search.git (push)
重命名远程仓库
$: git remote rename github gh$: git remoteorigingh
删除远程仓库
$: git remote rm github$: git remoteorigin
从远程仓库抓取数据,更新本地仓库:
$: git fetch originremote: 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)
- git remote
- git remote
- git remote
- git remote
- git remote
- git remote
- git remote
- git remote
- git remote
- git# remote
- git remote
- git remote
- git remote
- Git remote
- 【git】git remote
- git remote用法总结
- Git And Remote Repositories
- Change git remote URL
- Linux 设备模型 --- 总线设备驱动模型 --- 驱动
- NAT类型与UDP穿透
- 解决IAR中Go to definition of不可用问题
- 使用IOCP需要注意的一些问题~~(不断补充)
- 【Data】数据结构之线性表(2)
- git remote
- IE下载apk有时候会变成zip格式的包
- 简单makefile
- 在ubuntu下eclipse中一键调用javah自动生成头文件
- 25个增强iOS应用程序性能的提示和技巧
- Apache 出现make_sock: could not bind to address 0.0.0.0:80...
- 一段自我感觉还不错的代码
- Java加载资源文件的两种方法
- 3.动态存储管理和程序调试