一.背景

作为一名程序员,怎么能不懂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系列:常用命令的更多相关文章

  1. Git 基础 —— 常用命令

    Git 基础学习系列 Git 基础 -- 安装 配置 别名 对象 Git 基础 -- 常用命令 Git 基础 -- 常见使用场景 Git基础 -- Github 的使用 git init 创建 Git ...

  2. GIT 版本控制常用命令学习汇总

    GIT 版本控制常用命令汇总 git version 查看当前git版本信息 git help 获取全部命令帮助信息 git help <command> 获取指定命令帮助信息 git c ...

  3. git log 常用命令及技巧

    git log常用命令以及技巧 1.git log 如果不带任何参数,它会列出所有历史记录,最近的排在最上方,显示提交对象的哈希值,作者.提交日期.和提交说明.如果记录过多,则按Page Up.Pag ...

  4. Git基本常用命令

    Git基本常用命令如下: mkdir: XX (创建一个空目录 XX指目录名) pwd: 显示当前目录的路径. git init 把当前的目录变成可以管理的git仓库,生成隐藏.git文件. git ...

  5. Git是什么、Git的功能、为什么versioncontrol用Git、Git的常用命令、Git的优缺点

    Git是什么 git是目前世界上最先进的分布式版本控制系统(没有之一). Git是用于 Linux内核开发的版本控制工具.与常用的版本控制工具 CVS, Subversion 等不同,它采用了分布式版 ...

  6. Git stash 常用命令

    参考: Git: How to look at the stash Git学习笔记05--git stash Git stash 常用命令 1.git stash: 保存当前的工作进度: 2.git ...

  7. git之常用命令

    git之常用命令 1.下载远程仓库最新代码 $ git pull --rebase origin master 2.上传代码 $ git push origin master 3.退出编辑 ESC + ...

  8. git的常用命令。。

    git的常用命令.. git help <command>  显示command的help git show  显示某次提交的内容 git show $id git co -- <f ...

  9. Git - Git基本常用命令

    Git基本常用命令 mkdir:         XX (创建一个空目录 XX指目录名) pwd:          显示当前目录的路径. git init          把当前的目录变成可以管理 ...

随机推荐

  1. redis过期策略以及内存淘汰机制(理论+配置)

    一.redis的过期策略: redis的过期策略是:定期删除+惰性删除redis在存储数据时,可能会设置过期时间,而所谓的定期删除,指的是redis默认是每隔100ms就随机抽取一些设置了过期时间的k ...

  2. Centos-切换用户身份-su

    su 切换用户身份 相关选项 - 加载相应用户下环境变量 -c   使用某个身份执行一个指令 -m  改变用户身份不改变环境变量 切换为超级用户 su - 普通用户切换为超级用户需要输入密码,超级用户 ...

  3. Go map相关

    map Go语言中的map是一种无序的,基于key-value的数据解构,在Go语言中map是引用类型,因此必须初始化后才能使用. 以下示例将展示如何声明一个map类型,以及如何简单使用. 需要注意的 ...

  4. 手把手撸套框架-Victory框架1.0 详解

    目录 其实Victory框架1.0 在8月份就完成了,整个9月份都没有更新博客,主要还是因为松懈了. 所以,趁着国庆节的放假的时间把博客给更新一下,1.0总的来说算不得一个成熟的产品,但是拿来开发我们 ...

  5. [论文理解] Good Semi-supervised Learning That Requires a Bad GAN

    Good Semi-supervised Learning That Requires a Bad GAN 恢复博客更新,最近没那么忙了,记录一下学习. Intro 本文是一篇稍微偏理论的半监督学习的 ...

  6. 080 01 Android 零基础入门 02 Java面向对象 01 Java面向对象基础 01 初识面向对象 05 单一职责原则

    080 01 Android 零基础入门 02 Java面向对象 01 Java面向对象基础 01 初识面向对象 05 单一职责原则 本文知识点:单一职责原则 说明:因为时间紧张,本人写博客过程中只是 ...

  7. 068 01 Android 零基础入门 01 Java基础语法 08 Java方法 06 参数传递问题——基本数据类型传值

    068 01 Android 零基础入门 01 Java基础语法 08 Java方法 06 参数传递问题--基本数据类型传值 本文知识点:参数传递问题--基本数据类型传值 说明:因为时间紧张,本人写博 ...

  8. 最新vue项目添加水印

    在utils文件夹中创建 wartermark.ts 文件(位置看自己的组件放那,这都行),内容如下: 1 "use strict"; 2 3 const setWatermark ...

  9. Flink深入浅出: 应用部署与原理图解(v1.11)

    往期推荐: Flink深入浅出:内存模型 Flink深入浅出:JDBC Source从理论到实战 Flink深入浅出:Sql Gateway源码分析 Flink深入浅出:JDBC Connector源 ...

  10. nginx完美支持thinkphp3.2.2(需配置URL_MODEL=>1 pathinfo模式)

    来源:http://www.thinkphp.cn/topic/26657.html 第一步:配置SERVER块 server { listen 80; server_name www.domain. ...