Git命令集之一——配置参数

简介: Git命令集之一——配置参数

1.--version命令

使用git --version命令可以获取当前安装个Git版本号。

2.--help命令

获取Git帮助文档,信息示例如下:

usage: git [--version] [--help] [-C ] [-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>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize an existing one

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
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index

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
tag Create, list, delete or verify a tag object signed with GPG

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' and 'git help -g' list available subcommands and some
concept guides. See 'git help ' or 'git help '
to read about a specific subcommand or concept.

3.-C

这个命令用于修改git命令执行的目录,例如在桌面执行如下命令和进入到IBox文件夹中执行status是一样的:

git -C iBox status
4.-c =

在执行git命令时,添加这样的一个参数将使用新的value值替换掉config文件中name对应的参数配置的值来执行命令,示例如下:

git -c bare=false status
5.--exec-path

打印Git主程序所在的路径。

6.--html-path

打印Git文档所在路径。

7.--man-path

打印Git帮助文档所在路径。

8.--info-path

打印记录Git版本信息的文件路径。

9.--paginate

对Git的输出进行分页,对于大量信息的打印,可以分页进行查看。

10.--no-pager

对Git的输出不进行分页。

11.--git-dir=

设置Git仓库的路径,默认情况下,我们都是在当前Git仓库目录内执行Git命令,有时候也可以在其他目录下对某个Git仓库进行操作,例如:

git --git-dir=GitDemo/.git status
12.--work-tree=

设置Git的工作目录,这个目录中文件变化都会记录到Git管理仓库中。

13.--namespace=

设置Git的命名空间。

14.--bare

将Git仓库视为裸库。

目录
相关文章
|
存储 安全 开发工具
Git安装与配置:操作步骤+Gitee绑定
本文系统介绍了Git从安装配置到远程协作的全流程,涵盖基础概念、常用命令、分支管理、冲突解决及Gitee实战操作,助你高效掌握代码版本控制与团队协作技巧。
1806 155
|
网络安全 开发工具 git
配置本地环境以管理Git多账户SSH连接的方法
通过以上步駟设置后, 您可以轻松管理多個 Git 账户并且根据不同项目需求切换 SSH 密匙进行版本控制操作。
1724 20
|
开发工具 git
Git版本控制工具合并分支merge命令操作流程
通过以上步聚焦于技术性和操作层面指南(guidance), 可以有效管理项目版本控制(version control), 并促进团队协作(collaboration).
3144 15
|
安全 开发工具 git
git的常用操作命令
git的常用操作命令
957 57
|
存储 Java 开发工具
【Git】零基础入门:配置与初始操作实战指南
本文聚焦 Git 的“从 0 到 1”配置与基础操作,旨在帮助 Java 开发者快速掌握环境搭建、用户配置、仓库初始化、代码提交、版本回退等核心技能。内容设计上避免涉及复杂的分支策略或高级命令,以实用为导向,适合零基础入门者系统学习,为后续参与企业级项目开发奠定版本控制基础。
|
存储 项目管理 开发工具
Git常用命令及操作技巧
以上是Git的常用命令及操作技巧,尽管看起来有些繁琐,但实际上只要花费一些时间进行实践,您将很快熟练掌握。随着使用熟练度的提高,您会发现Git对项目管理和协同工作的强大帮助。
447 20
|
Linux 开发工具 git
版本控制工具:Git的安装和基本命令使用指南。
结束这段探险,掌握了Git你就等于掌握了一个宝藏,随时可以瞥见你的编程历程,轻松面对日后的挑战。Git,无疑是编程者的强大武器,开始你的Git探险之旅吧!
686 28
|
存储 缓存 开发工具
Git stash命令的详细使用说明及案例分析。
通过上述案例,我们看到stash命令能够在不丢失进度的情况下,帮助开发者临时切换开发上下文,这在处理多个任务或紧急bug时特别有用。正确使用Git stash可以大大提高开发的灵活性和效率。
3274 0
|
安全 Linux 网络安全
在Linux(CentOS和AWS)上安装更新的git2的方法并配置github-ssh
经过以上这些步骤,你现在就能在GitHub上顺利往返,如同海洋中的航海者自由驰骋。欢迎你加入码农的世界,享受这编程的乐趣吧!
767 10
|
安全 Shell 开发工具
Windows下使用git配置gitee远程仓库
就在前几天因为一些原因,我的电脑重装了系统,然后再重新配置git的环境的时候就遇到了一些小问题。所以我决定自己写一篇文章,以便以后再配置git时,避免一些错误操作,而导致全网搜方法,找对的文章去找对应的解决方法。下面为了演示方便就拿gitee来演示,不拿GitHub了写文章了。
832 0