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 <远程主机名> <远程分支名>
相关推荐
胖虎13 小时前
Git 一个本地仓库同时推送到两个远程仓库(详细教程)
git·多远程仓库·双远程仓库·git双远程·git备份
春日见14 小时前
如何创建一个PR
运维·开发语言·windows·git·docker·容器
stevenzqzq1 天前
git 常用操作
大数据·git
Curvatureflight1 天前
Git工作流最佳实践:从混乱到优雅
git
wu~9701 天前
GitHub永不遗忘,使用git push -f来覆盖的提交依旧保留
git·github
Vermouth_002 天前
git clone的时候提示access denied
git
qq_437657272 天前
清楚本地的git并重新登录
git
jiang_changsheng2 天前
工作流agent汇总分析 2
java·人工智能·git·python·机器学习·github·语音识别
顶点多余2 天前
版本控制器-git
linux·git
夔曦2 天前
Git工程日常下拉/上传完整流程(自用)
git