chengjiangtao@pc MINGW32 ~
$ git config --global user.name "chengjiangtao"

chengjiangtao@pc MINGW32 ~
$ git config --global user.email "1271419861@qq.com"

chengjiangtao@pc MINGW32 ~
$ mkdir learngit

chengjiangtao@pc MINGW32 ~
$ cd leargit
bash: cd: leargit: No such file or directory

chengjiangtao@pc MINGW32 ~
$ cd learngit

chengjiangtao@pc MINGW32 ~/learngit
$ pwd
/c/Users/chengjiangtao/learngit

chengjiangtao@pc MINGW32 ~/learngit
$ git init
Initialized empty Git repository in C:/Users/chengjiangtao/learngit/.git/

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git add readme

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git commit -m "wrote a readme file"
[master (root-commit) e05e1cf] wrote a readme file
1 file changed, 2 insertions(+)
create mode 100644 readme

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified: readme

no changes added to commit (use "git add" and/or "git commit -a")

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git diff readme
diff --git a/readme b/readme
index d8036c1..013b5bc 100644
--- a/readme
+++ b/readme
@@ -1,2 +1,2 @@
-Git is a version control system.
+Git is a distributed version control system.
Git is free software.
\ No newline at end of file

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git add readme

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

modified: readme

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git commit -m "add distributed"
[master b4c23b1] add distributed
1 file changed, 1 insertion(+), 1 deletion(-)

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git status
On branch master
nothing to commit, working directory clean

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git add readme

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git commit -m "append GPL"
[master e68c5cd] append GPL
1 file changed, 1 insertion(+), 1 deletion(-)

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git log
commit e68c5cd240ef48e1fa4a391f647b87e2cb1bdd1e
Author: chengjiangtao <1271419861@qq.com>
Date: Thu Jan 7 15:19:02 2016 +0800

append GPL

commit b4c23b13acdb4239f6c9915bc9297d1b0c685412
Author: chengjiangtao <1271419861@qq.com>
Date: Thu Jan 7 15:17:07 2016 +0800

add distributed

commit e05e1cf5433d70ce2ceaeb3db0dd6faebe17e385
Author: chengjiangtao <1271419861@qq.com>
Date: Thu Jan 7 15:12:52 2016 +0800

wrote a readme file

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git log --pretty=oneline
e68c5cd240ef48e1fa4a391f647b87e2cb1bdd1e append GPL
b4c23b13acdb4239f6c9915bc9297d1b0c685412 add distributed
e05e1cf5433d70ce2ceaeb3db0dd6faebe17e385 wrote a readme file

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git reset --hard HEAD^
HEAD is now at b4c23b1 add distributed

chengjiangtao@pc MINGW32 ~/learngit (master)
$ cat readme
Git is a distributed version control system.
Git is free software.
chengjiangtao@pc MINGW32 ~/learngit (master)
$ git log
commit b4c23b13acdb4239f6c9915bc9297d1b0c685412
Author: chengjiangtao <1271419861@qq.com>
Date: Thu Jan 7 15:17:07 2016 +0800

add distributed

commit e05e1cf5433d70ce2ceaeb3db0dd6faebe17e385
Author: chengjiangtao <1271419861@qq.com>
Date: Thu Jan 7 15:12:52 2016 +0800

wrote a readme file

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git reset --hard e68c5cd
HEAD is now at e68c5cd append GPL

chengjiangtao@pc MINGW32 ~/learngit (master)
$ cat readme
Git is a distributed version control system.
Git is free software distributed under the GPL.
chengjiangtao@pc MINGW32 ~/learngit (master)
$ git reflog
e68c5cd HEAD@{0}: reset: moving to e68c5cd
b4c23b1 HEAD@{1}: reset: moving to HEAD^
e68c5cd HEAD@{2}: commit: append GPL
b4c23b1 HEAD@{3}: commit: add distributed
e05e1cf HEAD@{4}: commit (initial): wrote a readme file

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified: readme

Untracked files:
(use "git add <file>..." to include in what will be committed)

license

no changes added to commit (use "git add" and/or "git commit -a")

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git add readme

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git add license

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

new file: license
modified: readme

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git commit -m "understand how stage works"
[master d9bb205] understand how stage works
2 files changed, 3 insertions(+), 1 deletion(-)
create mode 100644 license

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git status
On branch master
nothing to commit, working directory clean

chengjiangtao@pc MINGW32 ~/learngit (master)
$ cat readme
Git is a distributed version control system.
Git is free software distributed under the GPL.
Git has a mutable index called stage.
Git tracks changes.
chengjiangtao@pc MINGW32 ~/learngit (master)
$ git add readme

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

modified: readme

chengjiangtao@pc MINGW32 ~/learngit (master)
$ cat readme
Git is a distributed version control system.
Git is free software distributed under the GPL.
Git has a mutable index called stage.
Git tracks changes of files.
chengjiangtao@pc MINGW32 ~/learngit (master)
$ git commit -m "git tracks changes"
[master ab46c84] git tracks changes
1 file changed, 2 insertions(+), 1 deletion(-)

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified: readme

no changes added to commit (use "git add" and/or "git commit -a")

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git diff HEAD -- readme
diff --git a/readme b/readme
index db28b2c..9a8b341 100644
--- a/readme
+++ b/readme
@@ -1,4 +1,4 @@
Git is a distributed version control system.
Git is free software distributed under the GPL.
Git has a mutable index called stage.
-Git tracks changes.
\ No newline at end of file
+Git tracks changes of files.
\ No newline at end of file

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified: readme

no changes added to commit (use "git add" and/or "git commit -a")

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git checkout --readme
error: unknown option `readme'
usage: git checkout [<options>] <branch>
or: git checkout [<options>] [<branch>] -- <file>...

-q, --quiet suppress progress reporting
-b <branch> create and checkout a new branch
-B <branch> create/reset and checkout a branch
-l create reflog for new branch
--detach detach the HEAD at named commit
-t, --track set upstream info for new branch
--orphan <new-branch>
new unparented branch
-2, --ours checkout our version for unmerged files
-3, --theirs checkout their version for unmerged files
-f, --force force checkout (throw away local modifications)
-m, --merge perform a 3-way merge with the new branch
--overwrite-ignore update ignored files (default)
--conflict <style> conflict style (merge or diff3)
-p, --patch select hunks interactively
--ignore-skip-worktree-bits
do not limit pathspecs to sparse entries only
--ignore-other-worktrees
do not check if another worktree is holding the given ref
--progress force progress reporting

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git checkout -- readme

chengjiangtao@pc MINGW32 ~/learngit (master)
$ cat readme
Git is a distributed version control system.
Git is free software distributed under the GPL.
Git has a mutable index called stage.
Git tracks changes.
chengjiangtao@pc MINGW32 ~/learngit (master)
$ git add test.txt

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git commit -m "add test.txt"
On branch master
Untracked files:
TEST.txt

nothing added to commit but untracked files present

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git add TEST.txt

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git commit -m "add test,txt"
[master bb52781] add test,txt
1 file changed, 1 insertion(+)
create mode 100644 TEST.txt

chengjiangtao@pc MINGW32 ~/learngit (master)
$ rm TEST.txt

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git status
On branch master
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

deleted: TEST.txt

no changes added to commit (use "git add" and/or "git commit -a")

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git rm TEST.txt
rm 'TEST.txt'

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git commit -m "remove test.txt"
[master 2758aa6] remove test.txt
1 file changed, 1 deletion(-)
delete mode 100644 TEST.txt

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git status
On branch master
nothing to commit, working directory clean

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git checkout -- TEST.txt
error: pathspec 'TEST.txt' did not match any file(s) known to git.

chengjiangtao@pc MINGW32 ~/learngit (master)
$ ssh-keygen -t rsa -C "1271419861@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/chengjiangtao/.ssh/id_rsa):
Created directory '/c/Users/chengjiangtao/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/chengjiangtao/.ssh/id_rsa.
Your public key has been saved in /c/Users/chengjiangtao/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:mK6jZ9wuVi+fdsIDegb2GkXJewaYwDWHeqrqUvm3wnI 1271419861@qq.com
The key's randomart image is:
+---[RSA 2048]----+
| ...o.. |
| ...* . |
| .o = |
| . .. = |
| + = S |
| + oooo |
| o =.*.+ |
|o . EoB *.. |
|=..BoXo=o+ |
+----[SHA256]-----+

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git remote add origin git@github.com:chengjiangtao/learngit.git

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git push -u origin master
The authenticity of host 'github.com (192.30.252.129)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git push -u origin master
The authenticity of host 'github.com (192.30.252.128)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git remote add origin git@github.com:chengjiangtao/learngit.git
fatal: remote origin already exists.

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git push -u origin master
The authenticity of host 'github.com (192.30.252.129)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.129' (RSA) to the list of known hosts.
Counting objects: 20, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (15/15), done.
Writing objects: 100% (20/20), 1.65 KiB | 0 bytes/s, done.
Total 20 (delta 4), reused 0 (delta 0)
To git@github.com:chengjiangtao/learngit.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git clone git@github.com/chengjiangtao/CoffeeMachine
fatal: repository 'git@github.com/chengjiangtao/CoffeeMachine' does not exist

chengjiangtao@pc MINGW32 ~/learngit (master)
$ git clone git@github.com:chengjiangtao/CoffeeMachine
Cloning into 'CoffeeMachine'...
remote: Counting objects: 1943, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 1943 (delta 5), reused 0 (delta 0), pack-reused 1924
Receiving objects: 100% (1943/1943), 7.81 MiB | 174.00 KiB/s, done.
Resolving deltas: 100% (417/417), done.
Checking connectivity... done.
Checking out files: 100% (1618/1618), done.

chengjiangtao@pc MINGW32 ~/learngit (master

第三次作业,github的基本操作的更多相关文章

  1. 第三次作业 GIThub操作

    一.Git 客户端操作 1.在project文件夹初始化一个repository 2.添加并提交readme.txt 3.修改并查看状态 4.多次修改并提交 5.创建分支mv1并checkout至该分 ...

  2. oop 第三次作业 文件读写

    oop第三次作业 GitHub 对于迟交我感到很抱歉 031602510 体会 这次的用到了之前的文件读写,传参 定义函数有返回值,使代码更加简洁.面向对象的程序设计,在面对函数多元的情况下,编程更加 ...

  3. 17秋 软件工程 团队第三次作业 预则立&他山之石

    题目:团队作业-预则立&&他山之石 团队: 我说嘻(xì)哈(hà)你说侠 17秋 软件工程 团队第三次作业 预则立&他山之石 1.确立团队选题,建立和初步熟悉团队git的协作 ...

  4. 软件工程(QLGY2015)第三次作业点评(含成绩)

    相关博文目录: 第一次作业点评 第二次作业点评 第三次作业点评 团队信息 本页点评团队1-22,其他组见:http://www.cnblogs.com/xiaozhi_5638/p/4490764.h ...

  5. 第三周作业、实时操作系统µC/OS介绍及其它内容

    作业要求 见<实时控制软件设计>第三周作业 1 阅读笔记--µC/OS 1.1 基本介绍 µC/OS是由Micrium公司研发的实时操作系统,以µC/OS-II或µC/OS-III为内核, ...

  6. 248&258--高级软件工程第三次作业

    0 小组成员 马帅 / 2017202110248 齐爽爽 / 2017282110258 1 项目 GitHub 地址 GitHub:https://github.com/whumashuai/QT ...

  7. 程序设计第三次作业---C++计算器雏形

    Github链接:https://github.com/Wasdns/object-oriented 题目:程序设计第三次作业 程序设计第三次作业附加 我的程序设计第三次作业附加 代码规范 更新时间: ...

  8. 【西北师大-2108Java】第三次作业成绩汇总

    [西北师大-2108Java]第三次作业成绩汇总 熟悉PTA平台线上测试环境: 理解用户自定义类的定义: 掌握对象的声明: 学会使用构造函数初始化对象: 使用类属性与方法的使用掌握使用: 掌握pack ...

  9. 《Coderxiaoban团队》第三次作业:团队项目的原型设计

    <XXX团队>第三次作业:团队项目的原型设计 项目 内容 这个作业属于哪个课程 任课教师博客主页链接 这个作业的要求在哪里 实验七 团队作业3:团队项目原型设计与开发 团队名称 Coder ...

  10. BUAA OO 2019 第三单元作业总结

    目录 总 JML规格化设计 理论基础 工具链 规格验证 验证代码 代码静态检查 自动生成测试样例 生成结果 错误分析 作业设计 第九次作业 架构 代码实现 第十次作业 架构 代码实现 第十一次作业 架 ...

随机推荐

  1. leetcode 26

    26. Remove Duplicates from Sorted Array Given a sorted array, remove the duplicates in place such th ...

  2. poj3020

    define     n    the number of  ' * ' define     d    the number of couple of two points define     s ...

  3. java 设计模式-代理

    代理模式对其他对象提供一种代理以控制对这个对象的访问.      在某些情况下,一个对象不想或者不能直接引用另一个对象,而代理对象可以在客户端和目标对象之间起到中介的作用.       代理模式的思想 ...

  4. Android IOS WebRTC 音视频开发总结(四二)-- webrtc开发者大会

    本文主要介绍11月要在北京举办的webrtc开发者全球大会,文章来自博客园RTC.Blacker,支持原创,转载必须说明出处,更多详见www.rtc.help 其实两个月前就有圈内朋友跟我介绍这个大会 ...

  5. 将Windows 7导航窗格中的收藏夹、库、家庭组、网络全部去掉

    将Windows 7导航窗格中的收藏夹.库.家庭组.网络全部去掉,只剩下计算机.右键单击ShellFolder,选择权限->Administrators,勾选上“完全控制”,确定后双击右侧窗格中 ...

  6. Solaris引导和关闭

    OpenBoot PROM简称OBP,相当于PC的BIOS,是控制SUN服务器的引导过程.初始化配置某些硬件并提供某些诊断的工具.常见OBP命令 boot boot:从默认设备启动boot -s:从默 ...

  7. C/C++下Netbeans的配置

    目录 目录1 1 netbeans开发环境搭建2 2 netbeans工程管理2 2.1 采用IDE自动生成Makefile2 3 netbeans工程配置2 3.1 编译工具链3 3.1.1 添加配 ...

  8. javaSE第四天

    第四天    18 1. switch语句(掌握)    18 (1)格式:    18 (2)面试题    19 (3)执行流程:    19 (4)注意事项:    19 (5)案例:    19 ...

  9. 远程DLL注入

    界面如下: 关键部分代码如下: void CInjectDllDlg::OnBnClickedButtonInject() { // TODO: 在此添加控件通知处理程序代码 UpdateData(T ...

  10. JavaScript的匿名函数和模块化的使用方法

    对于开发人员来说,很多时候我们都会涉及到JavaScript的使用,而在使用过程中,最令人沮丧的就是变量没有相应的使用范围. 在开发中,对于任何变量.数组.函数.对象等,只要不在函数的内部,都会被默认 ...