git的使用方法记录

[email protected] MINGW64 ~/Desktop/gg
$ ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/guo/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/guo/.ssh/id_rsa.
Your public key has been saved in /c/Users/guo/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:pDqaFE1dMiQH0s/qc5EfK3KqUGa8Y2OqpjjqH3JmW48 [email protected]
The key‘s randomart image is:
+---[RSA 2048]----+
|  ..oo= .        |
|   ..+ +         |
|    .o. .        |
| . o  oo         |
|  * ....S        |
| + o..o .        |
|..B*o. o o       |
|oB==B.* o        |
|%o=+.E o         |
+----[SHA256]-----+

[email protected] MINGW64 ~/Desktop/gg
$

[email protected] MINGW64 ~/Desktop/gg
$

[email protected] MINGW64 ~/Desktop/gg
$

[email protected] MINGW64 ~/Desktop/gg
$ clone [email protected]:xuying/lesson1.git
bash: clone: command not found

[email protected] MINGW64 ~/Desktop/gg
$

[email protected] MINGW64 ~/Desktop/gg
$

[email protected] MINGW64 ~/Desktop/gg
$ git init
Initialized empty Git repository in C:/Users/guo/Desktop/gg/.git/

[email protected] MINGW64 ~/Desktop/gg (master)
$ clone [email protected]:xuying/lesson1.git
bash: clone: command not found

[email protected] MINGW64 ~/Desktop/gg (master)
$ git clone lone: command not found
fatal: Too many arguments.

usage: git clone [<options>] [--] <repo> [<dir>]

-v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --progress            force progress reporting
    -n, --no-checkout     don‘t create a checkout
    --bare                create a bare repository
    --mirror              create a mirror repository (implies bare)
    -l, --local           to clone from a local repository
    --no-hardlinks        don‘t use local hardlinks, always copy
    -s, --shared          setup as shared repository
    --recurse-submodules[=<pathspec>]
                          initialize submodules in the clone
    -j, --jobs <n>        number of submodules cloned in parallel
    --template <template-directory>
                          directory from which templates will be used
    --reference <repo>    reference repository
    --reference-if-able <repo>
                          reference repository
    --dissociate          use --reference only while cloning
    -o, --origin <name>   use <name> instead of ‘origin‘ to track upstream
    -b, --branch <branch>
                          checkout <branch> instead of the remote‘s HEAD
    -u, --upload-pack <path>
                          path to git-upload-pack on the remote
    --depth <depth>       create a shallow clone of that depth
    --shallow-since <time>
                          create a shallow clone since a specific time
    --shallow-exclude <revision>
                          deepen history of shallow clone, excluding rev
    --single-branch       clone only one branch, HEAD or --branch
    --shallow-submodules  any cloned submodules will be shallow
    --separate-git-dir <gitdir>
                          separate git dir from working tree
    -c, --config <key=value>
                          set config inside the new repository
    -4, --ipv4            use IPv4 addresses only
    -6, --ipv6            use IPv6 addresses only

[email protected] MINGW64 ~/Desktop/gg (master)
$

[email protected] MINGW64 ~/Desktop/gg (master)
$ git clone lone: command not found
fatal: Too many arguments.

usage: git clone [<options>] [--] <repo> [<dir>]

-v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --progress            force progress reporting
    -n, --no-checkout     don‘t create a checkout
    --bare                create a bare repository
    --mirror              create a mirror repository (implies bare)
    -l, --local           to clone from a local repository
    --no-hardlinks        don‘t use local hardlinks, always copy
    -s, --shared          setup as shared repository
    --recurse-submodules[=<pathspec>]
                          initialize submodules in the clone
    -j, --jobs <n>        number of submodules cloned in parallel
    --template <template-directory>
                          directory from which templates will be used
    --reference <repo>    reference repository
    --reference-if-able <repo>
                          reference repository
    --dissociate          use --reference only while cloning
    -o, --origin <name>   use <name> instead of ‘origin‘ to track upstream
    -b, --branch <branch>
                          checkout <branch> instead of the remote‘s HEAD
    -u, --upload-pack <path>
                          path to git-upload-pack on the remote
    --depth <depth>       create a shallow clone of that depth
    --shallow-since <time>
                          create a shallow clone since a specific time
    --shallow-exclude <revision>
                          deepen history of shallow clone, excluding rev
    --single-branch       clone only one branch, HEAD or --branch
    --shallow-submodules  any cloned submodules will be shallow
    --separate-git-dir <gitdir>
                          separate git dir from working tree
    -c, --config <key=value>
                          set config inside the new repository
    -4, --ipv4            use IPv4 addresses only
    -6, --ipv6            use IPv6 addresses only

[email protected] MINGW64 ~/Desktop/gg (master)
$

[email protected] MINGW64 ~/Desktop/gg (master)
$ lone: command not found
bash: lone:: command not found

[email protected] MINGW64 ~/Desktop/gg (master)
$

[email protected] MINGW64 ~/Desktop/gg (master)
$ ls

[email protected] MINGW64 ~/Desktop/gg (master)
$ git clone [email protected]:xuying/lesson1.git
Cloning into ‘lesson1‘...
The authenticity of host ‘git.coding.net (123.59.85.69)‘ can‘t be established
RSA key fingerprint is SHA256:jok3FH7q5LJ6qvE7iPNehBgXRw51ErE77S0Dn+Vg/Ik.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘git.coding.net,123.59.85.69‘ (RSA) to the list ofown hosts.
remote: Counting objects: 33, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 33 (delta 8), reused 0 (delta 0)
Receiving objects: 100% (33/33), done.
Resolving deltas: 100% (8/8), done.

[email protected] MINGW64 ~/Desktop/gg (master)
$ ls
lesson1/

[email protected] MINGW64 ~/Desktop/gg (master)
$ cd lesson1/

[email protected] MINGW64 ~/Desktop/gg/lesson1 (master)
$ ls
1.js

[email protected] MINGW64 ~/Desktop/gg/lesson1 (master)
$ git checkout -b writeNameFun
Switched to a new branch ‘writeNameFun‘

[email protected] MINGW64 ~/Desktop/gg/lesson1 (writeNameFun)
$ git add .

[email protected] MINGW64 ~/Desktop/gg/lesson1 (writeNameFun)
$ git commit -m‘老郭修改‘
[writeNameFun d7bb1cf] 老郭修改
 1 file changed, 16 insertions(+)
 create mode 100644 guodongsheng.js

[email protected] MINGW64 ~/Desktop/gg/lesson1 (writeNameFun)
$ git checkout master
Switched to branch ‘master‘
Your branch is up-to-date with ‘origin/master‘.

[email protected] MINGW64 ~/Desktop/gg/lesson1 (master)
$ git branch
* master
  writeNameFun

[email protected] MINGW64 ~/Desktop/gg/lesson1 (master)
$ git megre writeNameFun

git: ‘megre‘ is not a git command. See ‘git --help‘.

Did you mean this?
        merge

[email protected]guo-PC MINGW64 ~/Desktop/gg/lesson1 (master)
$

[email protected] MINGW64 ~/Desktop/gg/lesson1 (master)
$ git push origin writeNameFun
Merge made by the ‘recursive‘ strategy. key for IP address ‘123.59.85.131‘ to 1.js | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

[email protected] MINGW64 ~/Desktop/gg/lesson1 (master)
$ ^C



为的是让自己看

时间: 2024-10-12 14:47:09

git的使用方法记录的相关文章

git 打patch方法

git对比svn有很多优势,这里就不多说了,这里主要讨论打patch的方法. 1.由于打patch的时候一般是将别人的比较,想直接输入到自己的文件 2.采用web的git服务器查看别人的提交记录: 例如如下形式: diff --git a/mediatek/custom/common/hal/audioflinger/Audio_Customization_Common.h b/mediatek/custom/common/hal/audioflinger/Audio_Customization

git patch生成方法

先把修改commit掉,然后生产修改patch给提交代码的同事,具体操作步骤如下: 修改代码的同事: git format-patch al821_xxx origin/al821_xxx 会生成:0001-HQ00656135-xxx-al821_xxx.patch这样的patch文件 把这个patch给提交代码的同事 提交代码的同事,执行: git am 0001-HQ00656135-xxx-al821_xxx.patch 然后可以检查这个提交记录有没有问题,如果没有问题 执行git pu

git log 查看提交记录,参数:

git log 查看提交记录,参数:-n (n是一个正整数),查看最近n次的提交信息 $ git log -2 查看最近2次的提交历史记录 -- fileName fileName为任意文件名,查看指定文件的提交信息.(注:文件名应该放到参数的最后位置,通常在前面加上--并用空格隔开表示是文件.) $ git log file1 file2 查看file1文件file2文件的提交记录$ git log file/ 查看file文件夹下所有文件的提交记录 --branchName branchNa

android studio下gradle与Git错误解决方法

Error: Gradle: Execution failed for task ':mytask' > A problem occurred starting process 'command 'jni/ndk-build.cmd" 这是win7打开android程序出现的问题.解决方法:打开build.gradle,找到"commandLine"这行,把commandLine 'ndk-build', '-C', file('jni').absolutePath改为

ASP.NET页面优化性能提升方法记录

今天与大家分享:一种优化页面执行速度的方法.采用这个方法,可以使用页面的执行速度获得[8倍]的提升效果. 为了让您对优化的效果有个直观的了解,我准备了下面的测试结果截图: 测试环境:1. Windows Server 2003 SP22. Viaual Studio 2008,使用自带的WebDev.WebServer.EXE运行网站程序.3. (ThinkPad SL510):Core2 T6670 2.2GHz, 4G内存 二个红框中的数字反映了优化前后的执行时间.数字表明:优化前后,执行时

git工具使用方法及常用命令

git下载地址:https://github.com/git/gitgit环境变量配置:增加:GIT_HOME = C:\Git (文件夹为git软件的安装文件夹)Path添加: %GIT_HOME%\bin;(bin目录是解压后出现的文件夹,里面有git.exe) git命令大全:pwd 输出clone到本地的路径dir 显示本地文件cd work进入文件夹git clone http://github.com/22337383/workgit clone -b v2 https://gith

伪链接实现方法记录

链接一般作为页面跳转的手段,但是有时候需要使用链接形式,来实现ajax请求(非直接的页面跳转),或者来实现特殊的页面动画效果(点击链接,一段文字展开和收起). 总结起来有以下三种方法: 1.给href属性设置#,使得页面保持在当前页面, 但是页面位置会跳转到顶部,除非使用锚点跳转到特殊位置. <a href="#">click here(#)</a><br/> 2.使用javascript伪协议,给href属性设置 javascript:void(0

在Linux下搭建Git服务器的方法是什么样?

第一步 安装git:可以通过命令的方式快速安装,不同的linux的安装方法可能不一样,我的是采用的yum方法.ubuntu可以用apt-get命令. sudo yum install git 第二步 添加git用户,因为git服务器只限定来做项目代码交流的,专门开出一个用户来访问git服务器,比较好管理和控制. sudo adduser git 第三步 设置git用户的登陆密码.因为git提供ssh协议登陆功能,网上有的采用了存储客户端rsa_pub密码的方式来免密登陆,但是我按照这个方法存储了

git查看历史提交记录

#git查看历史提交记录 `git log --pretty=oneline filename`