转载: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进行第一次提交文件的更多相关文章

  1. Git学习之路(3)-提交文件到三个区

    ▓▓▓▓▓▓ 大致介绍 年过的差不多了,开始学习!小白学Git(持续更新) Git有三个工作区域: ◆ 工作区(Working Directory) ◆ 暂存区(Stage) ◆ 版本库(Reposi ...

  2. Git使用之一:创建仓储和提交文件

    一.前期工作:   1.准备自己的文件夹用于同步文件   2.准备自己的Git账号,并设置好项目(推荐使用国产的码云)   3.安装Git软件 (下载地址: 32-bit Git for Window ...

  3. failed to push some refs to 'git@github.com:***.git' hint: Updates were rejected b

    使用git push origin master的时候出现一下错误: 解决办法: git push -f origin master 如下:

  4. Git/GitHub 初用体验与总结

    Git,一个神奇而又陌生的东西,居然到现在才去了解它,就像有一位仁兄说的,现在不会用Git真的都不好意思说自己搞IT的. 简单的讲,这Git是目前最先进的分布式版本控制系统,和他相对应的就是众所周知的 ...

  5. 01: git & github

    目录:GIT其他篇 01: git & github 02: git分支管理 目录: 1.1 常见版本管理工具介绍 及 版本工具作用 1.2 git.GitHub和SVN比较 1.3 本地gi ...

  6. git 源码学习(init-db) 提交版本号 083c516331

    写在前面的废话: 学完git之后,还是感觉云里雾里的,于是乎,就想到了通过学习git源码,来加深git的熟练度,同时学习一下c语言编程. git源码学习,逐步分析 这篇帖子是逐步分析git源码的,将g ...

  7. Git/Github的使用并与Eclipse整合(zz)

    Git/Github的使用并与Eclipse整合 您的评价:          收藏该经验       Git简介 Git是一个免费的.分布式的版本控制工具,或是一个强调了速度快的源代码管理工具.每一 ...

  8. Git/Github的使用以及与Eclipse的整合

    Git简介       Git是一个免费的.分布式的版本控制工具,或是一个强调了速度快的源代码管理工具.每一个Git的工作目录都是一个完全独立的代码库,并拥有完整的历史记录和版本追踪能力,不依赖于网络 ...

  9. 记录git的初始设置,添加文件,提交文件

    1 初始配置 git config --global user.name ""  //配置用户名 git config --global user.email "&quo ...

随机推荐

  1. Tomcat负载均衡原理详解及配置(Apache2.2.19+Tomcat7.0.12)

    结构图 JAVA项目一般直接用Tomcat作为Web服务器.为了增加tomcat的性能和稳定性,我们一般采用balance和session同步机制. 下图列出了我们常用也是最简单的解决方案. 说明 1 ...

  2. 在Centos 7 上面 安装MySQL 5.7 简录

    In a web browser, visit mysql.com page: https://dev.mysql.com/downloads/repo/yum/ Locate the desired ...

  3. ODBC方式操作oracle数据库

    ODBC方式操作oracle数据库 一.查询语句: var strConn = System.Configuration.ConfigurationManager.ConnectionStrings[ ...

  4. [转]解读Unity中的CG编写Shader系列5——理论知识

    经过前面的系列文章中的三个例子,尽管代码简单,但是我想应该还有些地方没有100%弄明白,我们现在得回过头来补充一些必备的数学.图形学知识 1.图形管道第一个例子中我有提到顶点着色和片段着色在整个图形绘 ...

  5. code::blocks学习

    code::block不能调试问题 今天在codeblock不能进行调试,百度总结如下: 1 进行调试的必须是一个project而不能是一个单一的cpp文件. 2 project的路径不能包含中文,尽 ...

  6. OCP 11g认证052考试最新题库(带答案)-带38题

    38.Which three are true about the Automatic Database Diagnostic Monitor (ADDM)? A) Its findings are ...

  7. jQuery如何追加内容?匿名函数

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. 基于DALN方案C/S架构运用

    今天闲来无事,看到笔记本的蓝牙设备想着:可不可以实现电脑端播放手机端的音频. 刚刚开始想着基于蓝牙,尝试多次无解(主要原因是没有找到支持此功能的软件) 最后:有朋友建议可以研究下DALN方案解决这个需 ...

  9. myeclipse关于svn更新报错:OPTIONS of '/svn/Xxx': 403 Forbidden

    这个问题出现原因是其他人修改了我原本写作的代码位置,把两个类转移到了别的文件夹,我更新之后只显示除了他增加的文件夹而没有里面的类,同时爆出错误: 问题原因:svn版本号不匹配,即跳版本. 解决如下:r ...

  10. leetcode-819-Most Common Word(词频统计)

    题目描述: Given a paragraph and a list of banned words, return the most frequent word that is not in the ...