[Git & GitHub] 利用Git Bash进行第一次提交文件
转载:https://blog.csdn.net/dietime1943/article/details/72420042
利用Git Bash进行第一次提交文件
快下班的时候,MD群里有人问怎么向github上提交文件,下面进行简单的介绍:
(1) GitHub中创建一个工程
仓库的https地址:https://github.com/bluetata/blog.csdn.dietime1943.git
GitHub上创建仓库后生成的提示
Create a new repository on the command line :
touch
README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/bluetata/blog.csdn.dietime1943.git
git push -u origin master
Push an existing repository from the command line :
git
remote add origin https://github.com/bluetata/blog.csdn.dietime1943.git
git push -u origin master
(2) 初始化git目录
$
cd D:/001_workspaces/098_Github
$ git init
如果不执行这条命令, 就会出现错误 :fatal: Not a git repository (or any of the parent directories): .git 。
(3) 追加文件到缓存
$ git add -A//
表示将所有的已跟踪的文件的修改与删除和新增的未跟踪的文件都添加到暂存区
(4) 进行commit提交
$
git commit -m "commit test"
如果第一次进行提交会出现如下提示信息:
bluetata@IBM012-PC06874UMINGW64
/d/001_workspaces/098_Github/blog.csdn.dietime1943 (master)
$ git commit -m "commit test"
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'bluetata@IBM012-PC06874U.(none)')
根据提示按照如下输入即可(输入完后会弹出github登录的pop提示框):
bluetata@IBM012-PC06874UMINGW64
/d/001_workspaces/098_Github/blog.csdn.dietime1943 (master)
$ git config --global user.email "dietime1943@hotmail.com"
bluetata@IBM012-PC06874UMINGW64
/d/001_workspaces/098_Github/blog.csdn.dietime1943 (master)
$ git config --global user.name "bluetata"
(5) Push到远程仓库(提交到github服务器中)
$
git push -u origin master
最后:附上完整的操作记录:
注:本文原创由`bluetata`发布于blog.csdn.net、转载请务必注明出处。
[Git & GitHub] 利用Git Bash进行第一次提交文件的更多相关文章
- Git学习之路(3)-提交文件到三个区
▓▓▓▓▓▓ 大致介绍 年过的差不多了,开始学习!小白学Git(持续更新) Git有三个工作区域: ◆ 工作区(Working Directory) ◆ 暂存区(Stage) ◆ 版本库(Reposi ...
- Git使用之一:创建仓储和提交文件
一.前期工作: 1.准备自己的文件夹用于同步文件 2.准备自己的Git账号,并设置好项目(推荐使用国产的码云) 3.安装Git软件 (下载地址: 32-bit Git for Window ...
- failed to push some refs to 'git@github.com:***.git' hint: Updates were rejected b
使用git push origin master的时候出现一下错误: 解决办法: git push -f origin master 如下:
- Git/GitHub 初用体验与总结
Git,一个神奇而又陌生的东西,居然到现在才去了解它,就像有一位仁兄说的,现在不会用Git真的都不好意思说自己搞IT的. 简单的讲,这Git是目前最先进的分布式版本控制系统,和他相对应的就是众所周知的 ...
- 01: git & github
目录:GIT其他篇 01: git & github 02: git分支管理 目录: 1.1 常见版本管理工具介绍 及 版本工具作用 1.2 git.GitHub和SVN比较 1.3 本地gi ...
- git 源码学习(init-db) 提交版本号 083c516331
写在前面的废话: 学完git之后,还是感觉云里雾里的,于是乎,就想到了通过学习git源码,来加深git的熟练度,同时学习一下c语言编程. git源码学习,逐步分析 这篇帖子是逐步分析git源码的,将g ...
- Git/Github的使用并与Eclipse整合(zz)
Git/Github的使用并与Eclipse整合 您的评价: 收藏该经验 Git简介 Git是一个免费的.分布式的版本控制工具,或是一个强调了速度快的源代码管理工具.每一 ...
- Git/Github的使用以及与Eclipse的整合
Git简介 Git是一个免费的.分布式的版本控制工具,或是一个强调了速度快的源代码管理工具.每一个Git的工作目录都是一个完全独立的代码库,并拥有完整的历史记录和版本追踪能力,不依赖于网络 ...
- 记录git的初始设置,添加文件,提交文件
1 初始配置 git config --global user.name "" //配置用户名 git config --global user.email "&quo ...
随机推荐
- [LeetCode 题解]:Best Time to Buy and Sell Stock
前言 [LeetCode 题解]系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Say you ha ...
- Elasticsearch(1.1.1)基础教程pdf
基础概念 Elasticsearch有几个核心概念.从一开始理解这些概念会对整个学习过程有莫大的帮助. 接近实时(NRT) Elasticsearch是一个接近实时的搜索平台.这意味着, ...
- Django集成TinyMCE(admin后台+前台)
Django版本1.11,操作系统windows 7,在pycharm的terminal中使用pip install django-tinymce下载tinymce(前提是装的python里有pip功 ...
- 数独高阶技巧之八——SDC
在本系列的第四篇“简单异数链”中,向大家介绍了XY-Wing等一系列Wing类技巧,并提到可以用(拐弯的)数组的观念来理解这些结构,经过第六篇ALS的学习之后,大家回过头再去看Wing,应该可以发现相 ...
- 格式化JavaScript代码
javascript代码格式化工具 网上下载的js代码经常遇到代码已被压缩(注释.换行.缩进.空格.TAB等都被删除了),如果拿来学习.研究的话必定看到头晕.有些编辑器的“格 式化代码”功能可以解决这 ...
- 微信开发之c#下jssdk签名生成
参考文章 :微信JS-SDK 权限签名算法 C#版 这篇文章讲解的的比较详细,而且算法准确,但是这篇文章有几个错误的地方需要注意; url必须动态生成 url不能写死,否则就算结果和官方检测的一致,也 ...
- django drf 深入ModelSerializer
serializer用起来稍微麻烦,可以使用ModelSerializer,类似于django里的Form与ModelForm 1.定义ModelSerializer from rest_framew ...
- python学习之路 六 :装饰器
本节重点: 掌握装饰器相关知识 python装饰器就是用于拓展原来函数功能的一种函数,这个函数的特殊之处在于它的返回值也是一个函数,使用python装饰器的好处就是在不用更改原函数的代码前提下给函 ...
- HTML中DOM元素的子节点为空?!firstChild, lastChild, childeNodes[]为空
- mysql 代价
mysql cbo cost base optimizer 基于代价,数据是一直变化的oracle8 以前是rbo rule base optimizer 基于规则, 如果sql使用了索引,必须使用索 ...