Git

usage: git [--version] [--help] [-C <path>] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>] # 这些是在各种情况下使用的常见Git命令:
These are common Git commands used in various situations: # 启动一个工作区域(另请参阅:git help tutorial)
start a working area (see also: git help tutorial)
# 将存储库克隆到新目录中
clone Clone a repository into a new directory
# 创建一个空的Git存储库或重新初始化现有的存储库
init Create an empty Git repository or reinitialize an existing one # 在当前的变化上工作(另请参阅:git help everyday)
work on the current change (see also: git help everyday)
# 将文件内容添加到索引
add Add file contents to the index
# 移动或重命名文件,目录或符号链接
mv Move or rename a file, a directory, or a symlink
# 将当前HEAD重置为指定状态
reset Reset current HEAD to the specified state
# 从工作树和索引中删除文件
rm Remove files from the working tree and from the index # 检查历史和状态(另请参阅:git help revisions)
examine the history and state (see also: git help revisions)
# 使用二分查找找到引入错误的提交
bisect Use binary search to find the commit that introduced a bug
# 打印符合图案的线条
grep Print lines matching a pattern
# 显示提交日志
log Show commit logs
# 显示各种类型的对象
show Show various types of objects
# 显示工作树的状态
status Show the working tree status # 成长,标记和调整你的共同历史
grow, mark and tweak your common history
# 列出,创建或删除分支
branch List, create, or delete branches
# 切换分支或恢复工作树文件
checkout Switch branches or restore working tree files
# 记录对存储库的更改
commit Record changes to the repository
# 在提交,提交和工作树等之间显示更改
diff Show changes between commits, commit and working tree, etc
# 一起加入两个或更多发展历史
merge Join two or more development histories together
# 重新申请在另一个基本技巧之上提交
rebase Reapply commits on top of another base tip
# 创建,列出,删除或验证使用GPG签名的标签对象
tag Create, list, delete or verify a tag object signed with GPG # 协作(另请参阅:git help workflows)
collaborate (see also: git help workflows)
# 从另一个存储库下载对象和参考
fetch Download objects and refs from another repository
# 从另一个存储库或本地分支中获取并与其集成
pull Fetch from and integrate with another repository or a local branch
# 更新远程引用以及关联的对象
push Update remote refs along with associated objects # 'git help -a'和'git help -g'列出可用的子命令和一些
概念指南。 请参阅'git help <command>'或'git help <concept>'
阅读有关特定的子命令或概念。
'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.

从命令行创建一个新的仓库

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin http://192.168.0.240:3000/useadmin/Null.git
git push -u origin master

从命令行推送已经创建的仓库

git remote add origin http://192.168.0.240:3000/useadmin/Null.git
git push -u origin master
# 远程代码和本地代码合并
git pull --rebase origin master
git push -u origin master # 强制推送
git push -f git fetch
git merge
上面两句等价于
git pull
.gitignore 文件如何在 window 上创建?
.gitignore. 文件名两边都有一个点即可创建
# 注释
xxx 黑名单
!xxx 白名单 dos 命令行
copy nul .gitignore
如何删除 git add 添加到缓存中文件?

git rm -r -n --cached 文件/文件夹名称  ,预览将要删除的文件

一种是 git rm --cached "文件/文件路径",不删除物理文件,仅将该文件从缓存中删除;

一种是 git rm --f  "文件/文件路径",不仅将该文件从缓存中删除,还会将物理文件删除(不会回收到垃圾桶)。
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400 Failed reading client body
fatal: The remote end hung up unexpectedly
//设置 post 缓冲区大小
git config --global http.postBuffer 1048576000
合并分支
git fetch origin master
git merge origin/master

递归遍历

git clone --recursive https://github.com/caffe2/caffe2.git
git reset xxx --hard
git reflog
git reset old_xxx--hard
# 更新子模块
git submodule init
git submodule update

Git 命令行帮助的更多相关文章

  1. Git命令行(转用于学习和记录)

    Git命令行介绍和使用说明(持续更新) 参见:<Git 中文简体教程> 一. 命令“git”或者“git help”查询常用命令 [add]: “git add”——不但是用来添加不在版本 ...

  2. windows下使用TortoiseGit代替Git命令行操作

    windows下使用TortoiseGit代替Git命令行操作 大家在使用svn的时候,都非常喜欢使用小乌龟,也就是TortoiseSVN:那么git也有小乌龟版本,即TortoiseGit. 1.安 ...

  3. git命令行工作的正确姿势

    git命令行创建并提交新分支到mater分支的常规步骤 git branch new_branch git status 查看修改的文件 git add changed_files git commi ...

  4. 【重要】使用Git命令行上传到GitHub上

    [本人GitHub账号:] 用户名:chenhongshuang 密码:shuangshuang6300 邮箱:2452420371@qq.com 进入GitHub账号后 1·新建项目文件名称例dem ...

  5. git 命令行

    在使用 git 命令行之前需要下载安装软件官方网站:https://git-scm.com/window 或者 mac 等其它版本自行下载 使用方法一:安装后在项目文件夹中右键菜单会有个 Git Ba ...

  6. git命令行工作环境配置【转】

    转自:http://www.cocoachina.com/ios/20171115/21163.html 本文为CocoaChina网友whf5566投稿 前言 笔者一直使用git的图形化工具sour ...

  7. git 命令行下浏览器tig使用记录

    git 命令行下浏览器tig使用记录 tig 是一款优化 git 命令行的工具,使 git 命令行更加的便捷人性化 .如果用习惯了,会上瘾. 以下是一些使用记录: 安装成功后,在 Repo 文件夹下, ...

  8. Git的基本使用方法和安装&心得体会(使用git命令行)

    这是补发的,使用命令行操作的. (1)选择本地repository的路径 找到后点鼠标右键,选择git bash here. (2) clone到本地 在命令行输入 git clone ADDRESS ...

  9. 每日一条 git 命令行:git clone https://xxxxx.git -b 12.0 --depth 1

    每日一条 git 命令行:git clone https://xxxxx.git -b 12.0 --depth 1 -b 12.0:分支 12.0 --depth 1:depth 克隆深度,1 为最 ...

  10. 如何通过Git命令行把代码提交到github上

    1.http://www.cnblogs.com/leesf456/p/5169765.html   参考博客 背景:最近入手了mac,看见mac上的大神都是在用git命令行推代码,我很羡慕有木有,好 ...

随机推荐

  1. Android创建JSON格式数据

    Android创建JSON格式数据 作为上一篇博客的补充,简单那解说了一下Android创建JSON格式数据的小Demo. 1. 创建JSON格式数据 对于Android创建JSON格式数据.因为An ...

  2. Python数据处理——绘制函数图形以及数据拟合

    1.多项式拟合 对散点进行多项式拟合并打印出拟合函数以及拟合后的图形import matplotlib.pyplot as pltimport numpy as npx=np.arange(1,17, ...

  3. node.js 学习03

    node.js学习03 解决浏览器接收服务端信息之后乱码的问题: 服务器通过设置http响应报文头,告诉浏览器使用相应的编码 来解析网页. res.setHeader('Content','text/ ...

  4. 获取表数据的插入SQL

    DECLARE @TABLE_NAME VARCHAR(200) SET @TABLE_NAME = 'myFunction' --表名 DECLARE @TABLE_CONDITION VARCHA ...

  5. pouchdb快速入门教程

    a:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2p ...

  6. should + mocha 搭建简单的单元测试环境

    快速搭建测试环境,详细用法请百度和访问两者的github mocha: http://mochajs.org/ should: https://github.com/shouldjs/should.j ...

  7. Centos使用光盘作为本地yum源

    [root@localhost CentOS]# mkdir /media/CentOS把光盘加载到本地[root@localhost CentOS]# mount /dev/cdrom /media ...

  8. tcp3握手,作用,syn攻击

    tcp建立链接3次握手: 1.客户端→服务端,发送seq=x,syn=1 2.服务端→客户端,发送seq=y,syn=1,ack=x+1 3.客户端→服务端,发送seq=z,ack=y+1 三次握手作 ...

  9. IOS设计模式浅析之原型模式(Prototype)

    原型模式的定义 “使用原型实例指定创建对象的种类,并通过复制这个原型创建新的对象”.最初的定义出现于<设计模式>(Addison-Wesley,1994). 简单来理解就是根据这个原型创建 ...

  10. Thinkphp5 使用命令行模式(cli模式)

    Tp5的cli模式跟Tp3.2变化较大,有自己的一套方式,在这里做个搬运工,把Tp文档的东西搬运过来,方便大家. 原出处截图 创建自定义命令行 第一步,配置command.php文件,目录在appli ...