mark1-git

[email protected]2013-20131003RY MINGW64 ~
$ pwd
/c/Users/Administrator

[email protected]2013-20131003RY MINGW64 ~
$ cd e:/

[email protected]2013-20131003RY MINGW64 /e
$ pwd
/e

[email protected]2013-20131003RY MINGW64 /e
$ cd github

[email protected]2013-20131003RY MINGW64 /e/github
$ mkdir indoor

[email protected]2013-20131003RY MINGW64 /e/github
$ cd indoor

[email protected]2013-20131003RY MINGW64 /e/github/indoor
$ git init
Initialized empty Git repository in E:/github/indoor/.git/

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git add readme.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ gir commit -m "wrote a readme file "
bash: gir: command not found

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git commit -m "wrote a readme file "
[master (root-commit) 3792c32] wrote a readme file
 1 file changed, 1 insertion(+)
 create mode 100644 readme.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (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.txt

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

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git diff readme.txt
diff --git a/readme.txt b/readme.txt
index f7a8387..235b502 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1 +1,2 @@
-<B2><E2><CA><D4> ?<D3><C3>git <BF>?<A7><B6><CB>
\ No newline at end of file
+<B2><E2><CA><D4> ?<D3><C3>git <BF>?<A7><B6><CB>
+<B5>?<FE><D0><D0>
\ No newline at end of file

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git add readme.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   readme.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git commit -m "add distributed go commit"
[master 5f87ecf] add distributed go commit
 1 file changed, 2 insertions(+), 1 deletion(-)

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git status
On branch master
nothing to commit, working directory clean

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git log --pretty=oneline
5f87ecf99fe738341233181f2cb176e0fc249971 add distributed go commit
3792c3284467ed426d7a2be67ff692eb510a5bbb wrote a readme file

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git reset --hard HEAD^
HEAD is now at 3792c32 wrote a readme file

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ cat readme.txt
???? ???git ?????
[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git log
commit 3792c3284467ed426d7a2be67ff692eb510a5bbb
Author: Francecil <396324491@qq.com>
Date:   Sat Sep 19 21:11:16 2015 +0800

    wrote a readme file

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git reset --hard 5f
fatal: ambiguous argument ‘5f‘: unknown revision or path not in the working tree.
Use ‘--‘ to separate paths from revisions, like this:
‘git <command> [<revision>...] -- [<file>...]‘

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git reset --hard 5f87ecf
HEAD is now at 5f87ecf add distributed go commit

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git log
commit 5f87ecf99fe738341233181f2cb176e0fc249971
Author: Francecil <396324491@qq.com>
Date:   Sat Sep 19 21:25:31 2015 +0800

    add distributed go commit

commit 3792c3284467ed426d7a2be67ff692eb510a5bbb
Author: Francecil <396324491@qq.com>
Date:   Sat Sep 19 21:11:16 2015 +0800

    wrote a readme file

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git reflog
5f87ecf [email protected]{0}: reset: moving to 5f87ecf
3792c32 [email protected]{1}: reset: moving to HEAD^
5f87ecf [email protected]{2}: commit: add distributed go commit
3792c32 [email protected]{3}: commit (initial): wrote a readme file

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git log
commit 5f87ecf99fe738341233181f2cb176e0fc249971
Author: Francecil <396324491@qq.com>
Date:   Sat Sep 19 21:25:31 2015 +0800

    add distributed go commit

commit 3792c3284467ed426d7a2be67ff692eb510a5bbb
Author: Francecil <396324491@qq.com>
Date:   Sat Sep 19 21:11:16 2015 +0800

    wrote a readme file

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ cat readme.txt
测试 使用git 客户端
第二行
[email protected]2013-20131003RY MINGW64 /e/github/indoor (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.txt

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

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git diff
diff --git a/readme.txt b/readme.txt
index 235b502..141e7b4 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,2 +1,2 @@
-<B2><E2><CA><D4> ?<D3><C3>git <BF>?<A7><B6><CB>
-<B5>?<FE><D0><D0>
\ No newline at end of file
+测试 使用git 客户端
+第二行
\ No newline at end of file

[email protected]2013-20131003RY MINGW64 /e/github/indoor (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.txt

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

        LICENES.txt

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

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git add readme.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git add LICENES.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        new file:   LICENES.txt
        modified:   readme.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git commit -m "understand how stage works"
[master 45b7b4d] understand how stage works
 2 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 LICENES.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git status
On branch master
nothing to commit, working directory clean

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        1.txt

nothing added to commit but untracked files present (use "git add" to track)

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ rm 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git rm
usage: git rm [<options>] [--] <file>...

    -n, --dry-run         dry run
    -q, --quiet           do not list removed files
    --cached              only remove from the index
    -f, --force           override the up-to-date check
    -r                    allow recursive removal
    --ignore-unmatch      exit with a zero status even if nothing matched

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git rm 1.txt
fatal: pathspec ‘1.txt‘ did not match any files

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git status
On branch master
nothing to commit, working directory clean

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git add 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git commit 1,txt
error: pathspec ‘1,txt‘ did not match any file(s) known to git.
[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git commit 1.txt
Aborting commit due to empty commit message.

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git commit 1.txt
Aborting commit due to empty commit message.

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git add 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git commit 1.txt
Aborting commit due to empty commit message.

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git commit -m "commit 1.txt"
[master 2588ac4] commit 1.txt
 1 file changed, 1 insertion(+)
 create mode 100644 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ rm 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ ls -l
total 2
-rw-r--r-- 1 Administrator None 12 九月 19 13:44 LICENES.txt
-rw-r--r-- 1 Administrator None 37 九月 19 13:41 readme.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git checkout 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ rm 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git rm 1.txt
rm ‘1.txt‘

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git checkout 1.txt
error: pathspec ‘1.txt‘ did not match any file(s) known to git.

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git reset HEAD 1.txt
Unstaged changes after reset:
D       1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git checkout 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git rm 1.txt
rm ‘1.txt‘

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git commit
Aborting commit due to empty commit message.

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git commit -m "second rm 1.txt"
[master ef7c7e3] second rm 1.txt
 1 file changed, 1 deletion(-)
 delete mode 100644 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git reset 1.txt
fatal: ambiguous argument ‘1.txt‘: unknown revision or path not in the working tree.
Use ‘--‘ to separate paths from revisions, like this:
‘git <command> [<revision>...] -- [<file>...]‘

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git add 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git rm 1.txt
error: the following file has changes staged in the index:
    1.txt
(use --cached to keep the file, or -f to force removal)

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ rm 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git rm 1.txt
rm ‘1.txt‘

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git checkout 1.txt
error: pathspec ‘1.txt‘ did not match any file(s) known to git.

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git reset HEAD 1.txt

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git checkout 1.txt
error: pathspec ‘1.txt‘ did not match any file(s) known to git.

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git reset 1.txt
fatal: ambiguous argument ‘1.txt‘: unknown revision or path not in the working tree.
Use ‘--‘ to separate paths from revisions, like this:
‘git <command> [<revision>...] -- [<file>...]‘

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa.
Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:xxx xxx@qq.com
The key‘s randomart image is:
+---[RSA 2048]----+
|     o   .o.o.o..     |
|    o + . .o.o= . . .|
|     o = .o.oo + o =.|
|     .o.o.o . o o o o =|
|      o+S.o. o  .oo|
|      ++. .o.+ .  =o|
|     ..= +o.o.   .E +|
|      *o=   o.o..  +.|
|     o+=...o .o.o.    +|
+----[SHA256]-----+

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$ git remote add origin [email protected]:Francecil/InertailNavigation.git

[email protected]2013-20131003RY MINGW64 /e/github/indoor (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)? y
Please type ‘yes‘ or ‘no‘: yes
Warning: Permanently added ‘github.com,192.30.252.129‘ (RSA) to the list of known hosts.
Counting objects: 14, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (14/14), 1.13 KiB | 0 bytes/s, done.
Total 14 (delta 1), reused 0 (delta 0)
To [email protected]:Francecil/InertailNavigation.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

[email protected]2013-20131003RY MINGW64 /e/github/indoor (master)
$
时间: 2024-10-19 02:46:18

mark1-git的相关文章

Windows Git+TortoiseGit简易使用教程

转载自 http://blog.csdn.net/jarelzhou/article/details/8256139 官方教程:http://tortoisegit.org/docs/tortoisegit/(英文版) 为什么选择Git 效率 很多人有一种习惯吧,什么软件都要最新的,最好的.其实吧,软件就是工具,生产力工具,为的是提高我们的生产力.如果现有的工具已经可以满足生产力要求了,就没有必要换了.生产效率高低应当是选择工具的第一位. 历史 开源世界的版本控制系统,经历了这么几代: 第一代,

git 把本地创建的项目放到github上

很早之前就注册了Github,但对其使用一直懵懵懂懂,很不熟练.直到昨天做完百度前端技术学院的task,想把代码托管到Github上的时候发现自己对于Git的操作是如此之愚钝,所以今天决定把Git好好学习一遍,好让自己以后能更好地使用Github,主要还是通过Git教程 - 廖雪峰的官方网站来学习.简要步骤可以直接看最后的总结. Git的安装就不说了. 第一步:我们需要先创建一个本地的版本库(其实也就是一个文件夹). 你可以直接右击新建文件夹,也可以右击打开Git bash命令行窗口通过命令来创

git基本操作

一.分支操作 git init 初始化仓库 git status 查看仓库变化 git add 从工作树提交到暂存区 git commit 从暂存区提交到本地仓库 git commit --amend 修改上条记录的备注 git commit -am 'comment' 提交到暂存区和本地仓库 git diff 工作树和暂存区插播 git diff HEAD 工作树和最本地仓库的差别 git checkout -- filename 撤销工作需修改(修改.删除) git log [filenam

《个人-GIT使用方法》

本文章转载于:http://blog.csdn.net/gemmem/article/details/7290125 1. Git概念 1.1. Git库中由三部分组成 Git 仓库就是那个.git 目录,其中存放的是我们所提交的文档索引内容,Git 可基于文档索引内容对其所管理的文档进行内容追踪,从而实现文档的版本控制..git目录位于工作目录内. 1) 工作目录:用户本地的目录: 2) Index(索引):将工作目录下所有文件(包含子目录)生成快照,存放到一个临时的存储区域,Git 称该区域

Windows下使用Git Bash提交代码到GitHub

以前上传代码到Github主要是通过客户端Github Desktop或者网页,换电脑后感觉安装客户端太麻烦,了解命令行的方式就很有必要了. 这里的实验是把一些代码更改提交到Json.git仓库里. "ls" 为Linux命令,用于查看当前目录下的文件及文件夹. "git init" 命令用于对当前目录进行初始化,使当前的project-name目录交由Git进行管理. "git add" 命令可以对指定文件添加跟踪.如果后面跟空格加点号&quo

linux下git常用命令

1 安装: sudo apt-get install git 2 创建一个版本库: 新建一个文件夹,进入这个目录之后 git init 3 创建一个版本: git add 文件名或目录 #表示将当前文件的修改放入缓存区 先不提交 git commit -m '版本名称' #将缓冲区提交建立一个版本 4 查看版本记录 geit log 每条一行查看版本信息 git log --pretty=oneline 按图形方式查看 有合并版本的时候很清晰 git log --pretty=oneline -

Ubuntu Linux下通过代理(proxy)使用git上github.com

github.com,作为程序员的代码仓库,我们经常会用到.但有时候我们不能直接通过网络链接它,只能通过代理. 这里我有一台代理服务器,起初我以为在终端设置了代理环境就行了,其设置为在你的~/.bashrc里增加以下几行: export http_proxy="http://proxy-server:3128/" export https_proxy="http://proxy-server:3128/" export ftp_proxy="http://

git入门(4)团队中git保管代码常用操作

在团队中协作代码时候,一定要熟练使用以下git命令,不至于把代码库弄乱, PS:一定要提交自己代码(git push)时候,先进行更新本地代码库(git pull),不然提交异常 git常用命令 1·.clone相应项目 git clone ... 举个栗子(只是个栗子) git clone https://github.com/saucxs/watermark.git 2.新建分支并且切换到这个分支 git checkout -b 分支名(英文名) git chenckout -b dialy

已经在Git Server服务器上导入了SSH公钥,可用TortoiseGit同步代码时,还是提示输入密码?

GitHub虽好,但毕竟在国内访问不是很稳定,速度也不快,而且推送到上面的源码等资料必须公开,除非你给他交了保护费:所以有条件的话,建议大家搭建自己的Git Server.本地和局域网服务器都好,不信你试试,那速度,怎一个爽字了得! 默认情况下,使用TortoiseGit同步代码,每次都需要输入用户名和密码,但为了方便可以在客户端创建ssh密钥,用于服务器端和客户端的认证(详细过程大家可参考这里),但有时会出现“ 已经在Git Server服务器上导入了SSH公钥,可用TortoiseGit同步

使用git命令下载仓库中的代码

git是一种免费开源的分布式版本控制器.好像不能在页面点击下载源代码. 在Ubuntu下,安装git工具. sudo apt install git 使用命令下载 git clone 源代码仓库地址 如: #git clone git://git.denx.de/u-boot.git 地址是在仓库页面找到的.