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. 2014哈商大ICPC/ACM校赛解题报告

    被debug邀请去參加校赛,哎,被虐..我对不起工大.. 由于本人不搞ACM,算法处于HelloWorld水准.. 虽然题目除了鸟不拉屎星人之外都非常水,但我能做到这个程度,全然是超水平发挥了.. 数 ...

  2. node.js 学习02

    读写文件中的路径问题 readFile()读取文件函数中的./(相对路径)这个参数,相对的是执行node命令的路径,而不是相对于正在执行的这个js文件来查找.为了解决这个问题: __dirname(两 ...

  3. springboot学习(八) 使用jpa访问数据库

    1.添加maven依赖 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connecto ...

  4. McCabe环路复杂度计算方法

    环路复杂度用来定量度量程序的逻辑复杂度.以McCabe方法来表示. 在程序控制流程图中,节点是程序中代码的最小单元,边代表节点间的程序流.一个有e条边和n个节点的流程图F,可以用下述3种方法中的任何一 ...

  5. NIO之Charset类字符编码对象

    Charset类字符编码对象 介绍 java中使用Charset来表示编码对象 This class defines methods for creating decoders and encoder ...

  6. Failed to import package with error: Couldn't decompress package

    解压unitypackage的时候出错.原因是路径中包括中文字符,更改成英文路径就可以. 參考 Error while importing package: Couldn't decompress p ...

  7. 使用maven结合requirejs管理前端脚本

    已有的web项目,一直使用Maven做工程管理,现阶段前端调整为使用requirejs来负责模块加载依赖,同时使用jasmine来完成前端的UT. 便与在maven下统一管理,简单整理了下合在一起的使 ...

  8. 使用pycharm手动搭建python语言django开发环境(一)

    1)系统已经安装了python,django,pycharm 2)安装python的virtualenv模块.该模块通过创建一个虚拟化的python运行环境,将我们所需的依赖安装进去的,不同项目之间相 ...

  9. response.addCookie(cookie),添加失败

    问题:添加cookie到浏览器如下,在浏览器f12查看请求过程,发现cookie中只添加了:JSESSIONID E849DAFEE4A36B6D955F9D96D6D06207 却没有想要的“use ...

  10. 矩阵中的路径 剑指offer65题

    include "stdafx.h" #include<vector> #include<algorithm> #include<string> ...