git将本地仓库上传到远程仓库
来源:互联网 发布:编程一小时下载 编辑:程序博客网 时间:2024/06/11 12:54
在已有的Git库中搭建新库,并且将本地的git仓库,上传到远程服务器的git库中,从而开始一个新的项目
首先,在本地新建文件夹abc,进入到abc里面,然后git init。这样就在本地初始化了一个git项目abc。
然后,登录到远程的git服务器上,到gitrepo目录下面,mkdir abc.git。然后进入abc.git目录。git --bare init。这样就在服务器端建立了一个空的git项目。
之后,在本地,进入到abc目录里面,增加远程仓库。git remote -v 显示项目目前的远程仓库,因为是新建项目,所以结果为空。git remote add origin git://127.0.0.1/abc.git这样就增加了远程仓库abc。
最后,commit提交本地代码,git push origin master这样就把本地的git库上传到了远程git服务器的git库中了
也可以不登陆远程直接本地操作
1. git init
2. git add .
3. git commit -am "###" -------以上3步只是本地提交
4.git remote add origin git@xx.xx.xx.xx:repos/xxx/xxx/xxx.git
5.git push origin 本地分支:远程分支
git clone
$ git clone <版本库的网址> <本地目录名>
git clone支持多种协议,除了HTTP(s)以外,还支持SSH、Git、本地文件协议等,下面是一些例子。
$ git clone http[s]://example.com/path/to/repo.git/$ git clone ssh://example.com/path/to/repo.git/$ git clone git://example.com/path/to/repo.git/$ git clone /opt/git/project.git $ git clone file:///opt/git/project.git$ git clone ftp[s]://example.com/path/to/repo.git/$ git clone rsync://example.com/path/to/repo.git/
0 0
- git将本地仓库上传到远程仓库
- git将本地仓库上传到远程仓库
- git将本地仓库上传到远程仓库
- git将本地仓库上传到远程仓库
- git将本地仓库上传到远程仓库
- git将本地仓库上传到远程仓库
- git将本地仓库上传到远程仓库(转载)
- git将本地仓库上传到远程仓库
- git将本地仓库上传到远程仓库
- git将本地仓库上传到远程仓库
- 初步创建远程仓库,将本地仓库上传到git 远程仓库里
- 使用git将本地项目上传到git远程仓库
- 用命令将本地项目上传到git 远程仓库
- Git上传本地项目到远程仓库
- git上传本地代码到远程仓库
- Git将本地仓库上传到Github
- 将本地仓库文件上传到git
- Git 创建本地仓库并上传到远程仓库
- Velocity
- SpringMVC详细示例实战教程
- 如何提升代码逼格----接口隔离原则
- Erlang学习资源
- 内核日志及printk结构浅析
- git将本地仓库上传到远程仓库
- PHP基础知识总结(w3c)
- 内联元素 垂直居中 实现方法
- Eclipse报PermGen space内存不足的解决办法
- ValueAnimator及ObjectAnimator的使用
- 判断一个指定的经纬坐标是否落在一个多边形区域内?
- 工具类的方法
- jvm内存板块
- 如何提升代码逼格----迪米特法则