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 <远程主机名> <远程分支名>
相关推荐
qq_339191141 天前
服务器git pull每次都要输入密码,linux 设置git登录,linux设置git只输入一次账户密码
git
一颗小行星!1 天前
快速理解 Git submodule
git
A-Jie-Y1 天前
Git基础-核心概念与常用命令
git
夜珀1 天前
Git基础修炼手册:在AtomGit上玩转版本控制
git
golang学习记1 天前
Zed IDE官宣新招:Git Graph 正式支持!
ide·git
要记得喝水1 天前
适用于 Git Bash 的脚本,批量提交和推送多个仓库的修改
git·elasticsearch·bash
AI_Claude_code1 天前
专栏导论:开源项目贡献的价值与Git工作流全景图
git·开源
never forget shyang1 天前
CCS20.2.0使用教程
c语言·git·单片机
lifewange2 天前
常用的Git命令有哪些?
git
无限进步_2 天前
【C++】电话号码的字母组合:从有限处理到通用解法
开发语言·c++·ide·windows·git·github·visual studio