2020最新Git使用教程(超详细,很全面)

这篇Git使用教程详细介绍了Git的全局设置、创建目录、常用命令、版本回退、SSH连接、分支操作、忽略文件及标签管理。通过设置用户信息、初始化仓库、提交、推送、拉取等操作,帮助读者全面掌握Git的使用。
摘要由CSDN通过智能技术生成

Git使用教程

1.全局设置

设置用户信息,右键桌面打开“Git Bash Here”命令窗口,输入以下命令

git config --global user.name “用户名”

git config --global user.email “邮箱”

用户名:建议使用注册GitHub时,用的用户名

邮箱:建议使用注册GitHub时,用的邮箱

1.1查看配置信息

git config --list

git config user.name

git config user.email

2.创建目录

创建目录时,尽量不要带有中文和空格

在命令窗口中创建目录可以使用:mkdir “目录名称”

也可以自己新建文件夹

3.Git常用命令
  • 初始化Git本地仓库:git init
    git初始化

运行成功后,会在所在目录出现一个.git的文件夹,默认是隐藏的。

  • 查看当前状态:git status

  • 添加文件到缓存区:git add 文件名 (可以一次添加一个文件,也可以一次添加多个文件)

    • 语法1:git add 文件名1 文件名2 文件名3
    • 语法2&
Git 2.33 Release Notes ====================== Updates since Git 2.32 ---------------------- UI, Workflows & Features * "git send-email" learned the "--sendmail-cmd" command line option and the "sendemail.sendmailCmd" configuration variable, which is a more sensible approach than the current way of repurposing the "smtp-server" that is meant to name the server to instead name the command to talk to the server. * The userdiff pattern for C# learned the token "record". * "git rev-list" learns to omit the "commit " header lines from the output with the `--no-commit-header` option. * "git worktree add --lock" learned to record why the worktree is locked with a custom message. Performance, Internal Implementation, Development Support etc. * The code to handle the "--format" option in "for-each-ref" and friends made too many string comparisons on %(atom)s used in the format string, which has been corrected by converting them into enum when the format string is parsed. * Use the hashfile API in the codepath that writes the index file to reduce code duplication. * Repeated rename detections in a sequence of mergy operations have been optimized out for the 'ort' merge strategy. * Preliminary clean-up of tests before the main reftable changes hits the codebase. * The backend for "diff -G/-S" has been updated to use pcre2 engine when available. * Use ".DELETE_ON_ERROR" pseudo target to simplify our Makefile. * Code cleanup around struct_type_init() functions. * "git send-email" optimization. * GitHub Actions / CI update. (merge 0dc787a9f2 js/ci-windows-update later to maint). * Object accesses in repositories with many alternate object store have been optimized. * "git log" has been optimized not to waste cycles to load ref decoration data that may not be needed. * Many "printf"-like helper functions we have have been annotated with __attribute__() to catch placeholder/parameter
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值