Git 常用指令

Git 常用指令

  • 创建本地仓库 git init(需要进入相应的本地仓库目录)

  • 配置git

bash 复制代码
git config [--global] user.name "Your Name"   
git config [--global] user.email "email@example.com"  
  • 删除git配置
bash 复制代码
git config [--global] --unset user.name
git config [--global] --unset user.email
  • 添加文件

    1. 添加1个或多个文件夹到暂存区
    bash 复制代码
    git add [file1] [file2]
    1. 添加指定⽬录到暂存区,包括⼦⽬录
    bash 复制代码
    git add [dir]
    1. 添加当前目录下所有文件到暂存区
    bash 复制代码
    git add .
    1. 提交暂存区全部内容到本地仓库中
    bash 复制代码
    git commit -m "message"
  • 克隆远程仓库HTTPS方式

bash 复制代码
git clone https://
  • 推送
bash 复制代码
git push <远程主机名> <远程分支名>
  • 拉取
bash 复制代码
git pull <远程主机名> <远程分支名>
相关推荐
闲云一鹤1 天前
Git LFS 扫盲教程 - 你不会还在用 Git 管理大文件吧?
前端·git·前端工程化
vibecoding日记4 天前
为什么我就想要「线性历史 + Signed Commits」,GitHub 却把我当猴耍 🤬🎙️
git·编程工具
程序员小崔日记5 天前
如何将代码轻松上传到 Gitee?Git 使用全攻略!
git·gitee·上传
Bigger6 天前
为什么你的 Git 提交需要签名?—— Git Commit Signing 完全指南
git·开源·github
DianSan_ERP6 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
红豆子不相思7 天前
Tomcat 环境搭建与集群实战
服务器·git·tomcat
杰哥技术分享7 天前
Git 仓库迁移技术文档:从 CODING.net 迁移至腾讯云 CNB
git
梅孔立7 天前
Ansible 100 台服务器一键管控实战 进阶版
服务器·git·ansible
qq_426003967 天前
git切换当前分支到远程分支
git