git 上传项目到仓库
git 上传项目到仓库
第一步:建立仓库!
1、create new repository! 创建时最好选择 init (Initialize this repository with a README --> 自动生成README.md 文件) 2、如果未选择 init (没有README.md 文件,会报错)
可在git 执行一下命令创建
创建 -- ① git init
② touch README.md
上传 -- ③ git add README.md
④ git commit -m 'first_commit'
⑤ git remote add origin '项目地址'
⑥ git push origin master
第二步:克隆仓库!
1、确认公钥 -- 保持和远程服务器建立连接 ① ssh -T git@github.com 正确提示 -> 【Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
Hi findingsea! You've successfully authenticated, but GitHub does not provide shell access.】 2、clone 项目地址:https://github.com/findingsea/myRepoForBlog.git ② git clone https://github.com/findingsea/myRepoForBlog.git 成功后提示 -> Cloning into 'myRepoForBlog'... Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts. remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Receiving objects: 100% (3/3), done.
第三步:上传README.md文件(已初始化的可跳过此步骤)
1、创建 README.md 文件 ① git init ② touch README.md ③ git add README.md ④ git commit -m 'first_commit' ⑤ git remote add origin '项目地址' ⑥ git push origin master
第四步: push 文件
1、创建完README.md后,执行此步骤
① git add . ② git commit -m 'first_commit' ③ git remote add origin https://github.com/findingsea/myRepoForBlog.git ④ git push origin master
2、如果执行git remote add origin https://github.com/findingsea/myRepoForBlog.git,出现错误:
fatal: remote origin already exists
则执行以下语句:
git remote rm origin
3、再往后执行git remote add origin https://github.com/findingsea/myRepoForBlog.git 即可。 在执行git push origin master时,报错:
error:failed to push som refs to.......
4、则执行以下语句:
git pull origin master
5、补充 --
第四步最为重要!!!可重复执行
① git add . ② git commit -m '注释说明' ③ git remote add origin '项目地址' ④ git push origin master
*******************************************************
git 上传项目到仓库的更多相关文章
- 使用git上传项目到GitHub上
之前的博客有<使用git拉取GitHub上的项目>的文章,那么现在说一下,如何上传项目到GitHub上. 1. Git的.gitignore 文档配置 因为项目中可能有很多的图片还有nod ...
- eclipse中使用git上传项目
eclipse中使用git上传项目 先需要上传到本地仓库 先找到此选项打钩 再如下 再添加的属性则可以自动填充邮箱和密码 之后 右键选择import 点击找到git 选中 下一步 如果没有找到git ...
- 用git上传项目到GitHub或者码云全过程
用git上传项目到GitHub或者码云全过程 1. 会生成一个隐藏文件夹".git".这是一个不可删文件,因为暂存区和历史区还有一些其他的信息都在这里,删掉就不是一个完整的仓库了 ...
- Git 上传项目到 Github
Git 上传项目到 Github 该文章主要讲解Git 上传项目到 Github,Gitee同理 配置Git 下载.安装Git 下载后一路(傻瓜式安装)直接安装即可 如果第一次使用git的话,需要设置 ...
- 使用Git上传项目到GitHub仓库
GitHub账号注册很长时间了,但是没怎么上传过东西.今天学习如何利用Git工具将代码上传到GitHub,了解了一些常用命令 $ git config --global user.name " ...
- git 上传项目到远程仓库
电脑安装git客户端.注册github账号并登陆 到本地项目文件夹右键选择git bash here 输入个人信息(代码提交者) git config --global user.name " ...
- git上传项目代码到github
参考: git学习——上传项目代码到github github上传时出现error: src refspec master does not match any解决办法 git 上传本地文件到gith ...
- 在Eclipse里面使用git上传项目到码云
Eclispe上使用git 1.安装git 按照下图的步骤: 安装过就不用再安装了,没有安装的安装一下! 安装完毕之后:需要做一些初始化的设置: 2.上传项目到码云上 1.首先在码云上建立一个项目 2 ...
- git 上传项目
参考:https://blog.csdn.net/qq_28304687/article/details/69959238?fps=1&locationNum=8 第一部分 初次上传 1.先在 ...
随机推荐
- ssm整合-图片上传功能(转)
本文介绍 ssm (Spring+SpringMVC+Mybatis)实现上传功能. 以一个添加用户的案例介绍(主要是将上传文件). 一.需求介绍 我们要实现添加用户的时候上传图片(其实任何文件都可以 ...
- logrus学习笔记
logrus源码:https://github.com/sirupsen/logrus 1.logrus.Entry结构 1.1 类型 type Entry struct { Logger *Logg ...
- Docker自学纪实(四)搭建LNMP部署wordpress
我们在工作中最常用的就是LNMP网站平台 这个架构呢,是整个公司网站的核心 如果对于访问量较小的网站,可以直接在服务器上面部署 而如果是访问量很大的网站,那负载就是个很大的问题. 要么需要再买很多服务 ...
- PHP关闭notice级别的错误提示
1.在php.ini文件中改动error_reporting改为: error_reporting=E_ALL & ~E_NOTICE 2.如果你不能操作php.ini文件,你可以使用如下方法 ...
- C# 在窗口绘制图形(打点、画圆、画线)
需要包含命名空间 using System.Drawing; 画图前需要先创建画板 void Display() { Graphics g = this.CreateGraphics(); //创建画 ...
- python——集合
在python中,字典的亲戚就是集合,集合就是无映射关系的字典,花括号并不是字典的特权.如下面程序所示: >>> num = {} >>> type(num) &l ...
- HyperLedger Fabric 1.4 区块链技术定义(2.1)
区块链技术指使用点对点传输.共识机制.加密算法等技术,保证分布式数据库区块写入链中数据的一致性,达到去中心化和不可篡改的目的. 区块链就是一种特殊的分布式数据库,使用现有的各种成熟的技术, ...
- python-5模块
1-使用模块 import sys def test(): args = sys.argv if len(args)==1: print("hello word") elif le ...
- python面向对象的反射
python面向对象中的反射:通过字符串的形式操作对象相关的属性.python中的一切事物都是对象(都可以使用反射) getattr # 根据字符串的形式,去对象中找成员.hasattr # 根据字符 ...
- Trident整合MongoDB
MongoDB是大数据技术中常用的NoSql型数据库,它提供的大量的查询.聚合等操作函数,对于大量查询的日志系统来说,该MongoDB是大数据日志存储的福音.Storm的高级编程技术Trident,也 ...