Git系列:常用命令
一.背景
作为一名程序员,怎么能不懂Git那些常用命令呢?于是花费一点时间来总结Git命令。关于安装的话,就不讲了。
二.常用命令
1.配置全局的用户名称和用户邮箱
git config --global user.name "用户名" && git config --global user.email "邮箱账号"
git config --list
git config user.name
[root@centos-master ~]# git config --global user.name "robin" && git config --global user.email "code9342@gmail.com"
[root@centos-master ~]# git config --list
user.name=robin
user.email=code9342@gmail.com
[root@centos-master ~]# git config user.name
robin
[root@centos-master ~]#
2.查看帮助
git help -a
git help <command>
[root@centos-master ~]# git help -a
usage: git [--version] [--help] [-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>] available git commands in '/usr/libexec/git-core' add clean fast-import init merge-tree receive-pack revert tar-tree
add--interactive clone fetch init-db mergetool reflog rm unpack-file
am column fetch-pack log mktag relink send-pack unpack-objects
annotate commit filter-branch lost-found mktree remote sh-i18n--envsubst update-index
apply commit-tree fmt-merge-msg ls-files mv remote-ext shell update-ref
archive config for-each-ref ls-remote name-rev remote-fd shortlog update-server-info
bisect count-objects format-patch ls-tree notes remote-ftp show upload-archive
bisect--helper credential fsck mailinfo pack-objects remote-ftps show-branch upload-pack
blame credential-cache fsck-objects mailsplit pack-redundant remote-http show-index var
branch credential-cache--daemon gc merge pack-refs remote-https show-ref verify-pack
bundle credential-store get-tar-commit-id merge-base patch-id remote-testpy stage verify-tag
cat-file describe grep merge-file peek-remote repack stash web--browse
check-attr diff hash-object merge-index prune replace status whatchanged
check-ignore diff-files help merge-octopus prune-packed repo-config stripspace write-tree
check-ref-format diff-index http-backend merge-one-file pull request-pull submodule
checkout diff-tree http-fetch merge-ours push rerere submodule--helper
checkout-index difftool http-push merge-recursive quiltimport reset subtree
cherry difftool--helper imap-send merge-resolve read-tree rev-list symbolic-ref
cherry-pick fast-export index-pack merge-subtree rebase rev-parse tag 'git help -a' and 'git help -g' lists available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
3.克隆远程仓库
git -b dev git仓库
4.初始化git
git init
[root@centos-master git]# mkdir my-project
[root@centos-master git]# cd my-project/
[root@centos-master my-project]# git init
Initialized empty Git repository in /opt/git/my-project/.git/
[root@centos-master my-project]# ls -a
. .. .git
[root@centos-master my-project]#
暂时不写了!感觉没啥好写的,拿着就能用那种
Git系列:常用命令的更多相关文章
- Git 基础 —— 常用命令
Git 基础学习系列 Git 基础 -- 安装 配置 别名 对象 Git 基础 -- 常用命令 Git 基础 -- 常见使用场景 Git基础 -- Github 的使用 git init 创建 Git ...
- GIT 版本控制常用命令学习汇总
GIT 版本控制常用命令汇总 git version 查看当前git版本信息 git help 获取全部命令帮助信息 git help <command> 获取指定命令帮助信息 git c ...
- git log 常用命令及技巧
git log常用命令以及技巧 1.git log 如果不带任何参数,它会列出所有历史记录,最近的排在最上方,显示提交对象的哈希值,作者.提交日期.和提交说明.如果记录过多,则按Page Up.Pag ...
- Git基本常用命令
Git基本常用命令如下: mkdir: XX (创建一个空目录 XX指目录名) pwd: 显示当前目录的路径. git init 把当前的目录变成可以管理的git仓库,生成隐藏.git文件. git ...
- Git是什么、Git的功能、为什么versioncontrol用Git、Git的常用命令、Git的优缺点
Git是什么 git是目前世界上最先进的分布式版本控制系统(没有之一). Git是用于 Linux内核开发的版本控制工具.与常用的版本控制工具 CVS, Subversion 等不同,它采用了分布式版 ...
- Git stash 常用命令
参考: Git: How to look at the stash Git学习笔记05--git stash Git stash 常用命令 1.git stash: 保存当前的工作进度: 2.git ...
- git之常用命令
git之常用命令 1.下载远程仓库最新代码 $ git pull --rebase origin master 2.上传代码 $ git push origin master 3.退出编辑 ESC + ...
- git的常用命令。。
git的常用命令.. git help <command> 显示command的help git show 显示某次提交的内容 git show $id git co -- <f ...
- Git - Git基本常用命令
Git基本常用命令 mkdir: XX (创建一个空目录 XX指目录名) pwd: 显示当前目录的路径. git init 把当前的目录变成可以管理 ...
随机推荐
- PHPExcel集成对数据导入和导出
<?php /** * Created by PhpStorm. * User: admin * Date: 2017/8/15 * Time: 9:07 */ class User exten ...
- Spring 配置文件AOP
1 <!-- 配置切面bean --> 2 <bean id="permAspect" class="com.tx.spring.aspect.Perm ...
- Python-函数式编程-map reduce filter lambda 三元表达式 闭包
lambda 匿名函数,核心是作为算子,处理逻辑只有一行但具有函数的特性,核心用于函数式编程中 三元运算符 其实本质上是if分支的简化版,满足条件返回 if 前面的值,不满足条件返回 else后面的值 ...
- Vue编写的页面部署到springboot网站项目中出现页面加载不全问题
问题描述: 在用Vue脚手架 编写出一个页面之后, 部署到后台项目中, 因为做的是一个页面 按理来说 怎么都能够在服务器上运行 , 我也在自己的node环境测试 , 在同学的springboot上运行 ...
- Win7 64X 安装VisualSVNServer 2.6.0过程中出现Custom action InstallWMISchemaExcute failed: Cannot query proxy blanket: No such interface supported (0x80004002)
Win7 64X 安装VisualSVNServer 2.6.0过程中出现错误:Custom action InstallWMISchemaExcute failed: Cannot query pr ...
- Trie树【字典树】浅谈
最近随洛谷日报看了一下Trie树,来写一篇学习笔记. Trie树:支持字符串前缀查询等(目前我就学了这些qwq) 一般题型就是给定一个模式串,几个文本串,询问能够匹配前缀的文本串数量. 首先,来定义下 ...
- CentOS 7安装docker和常用指令
1.安装 yum -y install docker 2.启动 systemctl start docker // 启动 docker -v //查看版本号 systemctl stop docker ...
- mac常用指令
mkdir demo //创建一个文件夹 touch index.html // 创建一个html文件 rm rouch index.html //删除找个index.html文件 rmdir dem ...
- 《我想进大厂》之Redis夺命连环11问
这是面试题系列第三篇--redis专题. 说说Redis基本数据类型有哪些吧 字符串:redis没有直接使用C语言传统的字符串表示,而是自己实现的叫做简单动态字符串SDS的抽象类型.C语言的字符串不记 ...
- MeteoInfoLab脚本示例:TRMM 3B43 HDF数据
TRMM 3B43是卫星观测月平均降水量产品,是HDF的格点数据.需要注意的是数据中降水变量维的顺序里经度维在前纬度维在后,这与通常的设置(纬度维在前经度维在后)相反,需要对获取的二维数组进行转置,使 ...