第三次作业,github的基本操作
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的基本操作的更多相关文章
- 第三次作业 GIThub操作
一.Git 客户端操作 1.在project文件夹初始化一个repository 2.添加并提交readme.txt 3.修改并查看状态 4.多次修改并提交 5.创建分支mv1并checkout至该分 ...
- oop 第三次作业 文件读写
oop第三次作业 GitHub 对于迟交我感到很抱歉 031602510 体会 这次的用到了之前的文件读写,传参 定义函数有返回值,使代码更加简洁.面向对象的程序设计,在面对函数多元的情况下,编程更加 ...
- 17秋 软件工程 团队第三次作业 预则立&他山之石
题目:团队作业-预则立&&他山之石 团队: 我说嘻(xì)哈(hà)你说侠 17秋 软件工程 团队第三次作业 预则立&他山之石 1.确立团队选题,建立和初步熟悉团队git的协作 ...
- 软件工程(QLGY2015)第三次作业点评(含成绩)
相关博文目录: 第一次作业点评 第二次作业点评 第三次作业点评 团队信息 本页点评团队1-22,其他组见:http://www.cnblogs.com/xiaozhi_5638/p/4490764.h ...
- 第三周作业、实时操作系统µC/OS介绍及其它内容
作业要求 见<实时控制软件设计>第三周作业 1 阅读笔记--µC/OS 1.1 基本介绍 µC/OS是由Micrium公司研发的实时操作系统,以µC/OS-II或µC/OS-III为内核, ...
- 248&258--高级软件工程第三次作业
0 小组成员 马帅 / 2017202110248 齐爽爽 / 2017282110258 1 项目 GitHub 地址 GitHub:https://github.com/whumashuai/QT ...
- 程序设计第三次作业---C++计算器雏形
Github链接:https://github.com/Wasdns/object-oriented 题目:程序设计第三次作业 程序设计第三次作业附加 我的程序设计第三次作业附加 代码规范 更新时间: ...
- 【西北师大-2108Java】第三次作业成绩汇总
[西北师大-2108Java]第三次作业成绩汇总 熟悉PTA平台线上测试环境: 理解用户自定义类的定义: 掌握对象的声明: 学会使用构造函数初始化对象: 使用类属性与方法的使用掌握使用: 掌握pack ...
- 《Coderxiaoban团队》第三次作业:团队项目的原型设计
<XXX团队>第三次作业:团队项目的原型设计 项目 内容 这个作业属于哪个课程 任课教师博客主页链接 这个作业的要求在哪里 实验七 团队作业3:团队项目原型设计与开发 团队名称 Coder ...
- BUAA OO 2019 第三单元作业总结
目录 总 JML规格化设计 理论基础 工具链 规格验证 验证代码 代码静态检查 自动生成测试样例 生成结果 错误分析 作业设计 第九次作业 架构 代码实现 第十次作业 架构 代码实现 第十一次作业 架 ...
随机推荐
- leetcode 66
66. Plus One Given a non-negative number represented as an array of digits, plus one to the number. ...
- RequireJS首次加载偶尔失败
现象:第一次加载JS文件,首次加载偶尔失败: 原因:require(['jquery', 'operamasks', 'zTree', 'jQueryCookie'],中前后引用同步加载: 解决方式: ...
- Storyboard里面的几种Segue区别和视图的切换
几种segue:push.modal.popover.replace.cutom. 一.视图切换类型介绍 1.在iPhone和iPad中,segue的类型是不同的. 2.在iPhone中,segue有 ...
- [leetcode]_Merge Sorted Array
题目:合并两个有序数组A , B,将合并后的数组存到A中.假设A的空间足够装下A和B所有的元素. 思路:这道题考虑如果正向扫描两个数组,则每插入一个元素,则需移动A后的所有元素.换个角度想,既然元素个 ...
- dedecms 根据key取得联动类型(enum)值
---恢复内容开始--- //$key:如城市的ID,$enum_file data/enums中的文件 function get_enum_data($key, $enum_file) { ...
- Creating an API-Centric Web Application[转]
Creating an API-Centric Web Application 转自 http://hub.tutsplus.com/tutorials/creating-an-api-centric ...
- C#发送邮件源码
介绍 SMTP(Simple Mail Transfer Protocol)即简单邮件传输协议,它是一组用于由源地址到目的地址传送邮件的规则,由它来控制信件的中转方式.SMTP协议属于TCP/IP协议 ...
- 访问svc 文件,编译器错误消息: CS0016,未能写入输出文件
编译错误 说明: 在编译向该请求提供服务所需资源的过程中出现错误.请检查下列特定错误详细信息并适当地修改源代码. 编译器错误消息: CS0016: 未 ...
- asp.net mvc razor html encoding
HTML Encoding 为了跨站点的脚本攻击,Razor 语法会直接将脚本代码编码输出. @{string message = "<script>alert('haacked ...
- MvcAdmin功能介绍
应群友要求做一个介绍(QQ群:159227188) 已经迁移到这里,已经迁移到这里,已经迁移到这里,重要的事情说三遍 http://www.cnblogs.com/RainbowInTheSky/p/ ...