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 把当前的目录变成可以管理 ...
随机推荐
- Token机制,session机制
对于初学者来说,对Token和Session的使用难免会限于困境,开发过程中知道有这个东西,但却不知道为什么要用他? session机制:就是一个id号(cookie里面携带一个sessionid), ...
- 1-浅谈 python变量
浅谈 python变量 python变量概念 程序执行的过程中,很多数据都在变化的过程,我们需要一种机制把这种变化体现出来,变量是我们记录这种变化的方式. python以及其它各种语言的变量 ,其作用 ...
- 【音乐爬虫】Python爬虫-selenium+browsermob-proxy 解决动态网页 js渲染问题
1.一般的python爬虫很简单,直接请求对应网址,解析返回的数据即可,但是有很多网站的数据的js动态渲染的,你直接请求是得不到对应的数据的 这时就需要其它手段来处理了. 2.以一个例子来说明,整个过 ...
- SPI通信基础学习
SPI是"Serial Peripheral Interface"的缩写,即"串行外设接口",是摩托罗拉公司推出的一种串行接口通信协议. 接线的示意图: SPI ...
- Hadoop理论基础
Hadoop是 Apache 旗下的一个用 java 语言实现开源软件框架,是一个开发和运行处理大规模数据的软件平台.允许使用简单的编程模型在大量计算机集群上对大型数据集进行分布式处理. 特性:扩 ...
- 8-kubernetes-安全
kubernetes安全框架 访问K8S集群的资源需要过三关:认证.鉴权.准入控制,任意一个不通过都会失败 普通用户若要安全访问集群API server,往往需要证书.token或者用户名+密码,po ...
- 用 Java 实现的八种常用排序算法
八种排序算法可以按照如图分类 交换排序 所谓交换,就是序列中任意两个元素进行比较,根据比较结果来交换各自在序列中的位置,以此达到排序的目的. 1. 冒泡排序 冒泡排序是一种简单的交换排序算法,以升序排 ...
- 微信小程序实时将less编译为wxss
1.npm或者yarn全局安装wxss-cli npm install -g wxss-cli 2.运行waxes-cli命令(mp_wx为小程序目录) wxss ./mp_wx 实时监听mp_wx目 ...
- 2017-18一《电子商务概论》专科作业--经管B1601/2、经管B1631
第1次作业: 1.你如何来定义和理解电子商务?电子商务对社会经济带了怎样的影响,企业.消费者的反应如何?你知道哪些电子商务企业,他们都属于什么类型? 2.请详细阐述应该如何关注哪些事项才能在淘宝网成功 ...
- ASP.Net Core3.1 生成二维码填坑
ASP.Net Core3.1 使用QrCode生成二维码 部署到Linux报错 The type initializer for 'System.DrawingCore.GDIPlus' threw ...