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仓库视为裸库。

目录
相关文章
|
4月前
|
开发工具 git
git 常用命令
这些只是 Git 命令的一部分,Git 还有许多其他命令和选项,可根据具体需求进行深入学习和使用。熟练掌握这些命令能够帮助你更高效地管理代码版本和协作开发。
|
2月前
|
网络安全 开发工具 git
mac git clone命令提示git@gitee.com: Permission denied (publickey).问题修复
mac git clone命令拉取gitee上项目代码时提示密钥问题
|
2月前
|
Java 网络安全 开发工具
Git进阶笔记系列(01)Git核心架构原理 | 常用命令实战集合
通过本文,读者可以深入了解Git的核心概念和实际操作技巧,提升版本管理能力。
|
2月前
|
前端开发 Java 开发工具
Git使用教程-将idea本地Java等文件配置到gitte上【保姆级教程】
本内容详细介绍了使用Git进行版本控制的全过程,涵盖从本地仓库创建到远程仓库配置,以及最终推送代码至远程仓库的步骤。
53 0
|
3月前
|
移动开发 jenkins 持续交付
jenkins配置git
通过上述步骤,您可以在 Jenkins 中成功配置 Git,从而实现自动拉取代码并进行构建和部署。这些配置不仅提高了开发效率,还保证了代码的连续集成和交付。确保每一步配置正确,以避免在实际使用中遇到问题。
192 1
|
3月前
|
机器学习/深度学习 Shell 网络安全
【Git】Git 命令参考手册
Git 命令参考手册的扩展部分,包含了从基础操作到高级功能的全面讲解。
95 3
|
4月前
|
缓存 Java Shell
[Git]入门及其常用命令
本文介绍了 Git 的基本概念和常用命令,包括配置、分支管理、日志查看、版本回退等。特别讲解了如何部分拉取代码、暂存代码、删除日志等特殊需求的操作。通过实例和图解,帮助读者更好地理解和使用 Git。文章强调了 Git 的细节和注意事项,适合初学者和有一定基础的开发者参考。
87 1
[Git]入门及其常用命令
|
4月前
|
Ubuntu Shell 开发工具
ubuntu/debian shell 脚本自动配置 gitea git 仓库
这是一个自动配置 Gitea Git 仓库的 Shell 脚本,支持 Ubuntu 20+ 和 Debian 12+ 系统。脚本会创建必要的目录、下载并安装 Gitea,创建 Gitea 用户和服务,确保 Gitea 在系统启动时自动运行。用户可以选择从官方或小绿叶技术博客下载安装包。
151 2
|
4月前
|
算法 网络安全 开发工具
[Git]关联远程库的两种方法及配置
本文介绍了 git 的四种连接方式:ssh 连接、HTTPS 连接、SVN 连接和 SVN + ssh 连接,重点讲解了 HTTPS 和 ssh 连接方式的配置及注意事项。文章详细解释了 HTTPS 连接的身份验证过程、常见问题及解决方案,以及 ssh 连接的公钥和私钥的创建、配置方法。此外,还介绍了如何在同一台电脑上连接多个 gitee 账号的方法。
344 0
[Git]关联远程库的两种方法及配置
|
4月前
|
Linux 网络安全 开发工具
IDEA如何配置git和github
【11月更文挑战第14天】本指南详细介绍了如何在 IntelliJ IDEA 中配置 Git 和 GitHub,包括检查和设置 Git 路径、测试配置,以及通过 SSH 或 HTTPS 方式配置 GitHub 仓库的具体步骤。完成配置后,用户可在 IDEA 中轻松进行版本控制操作。
602 0