使用命令行管理git项目

初始化一个新的Git仓库

git init

添加文件到暂存区

git add <file>

提交暂存区的更改到仓库

git commit -m "commit message"

查看当前仓库的状态

git status

查看提交历史

git log

查看文件的改动

git diff <file>

创建一个新分支

git branch <branch-name>

切换到一个已存在的分支

git checkout <branch-name>

合并分支

git merge <branch-name>

删除分支

git branch -d <branch-name>

推送到远程仓库

git push <remote> <branch>

拉取远程仓库的更改

git pull <remote> <branch>

克隆远程仓库到本地

git clone <repository>

添加远程仓库地址

git remote add <remote> <url>

拉取所有远程分支的更新

git fetch --all

设置Git的用户名和邮箱

git config --global user.name "Your Name"

git config --global user.email "your.email@example.com"

使用命令行管理git项目 设置tag

复制代码
git tag -a v1.0.0 -m "My version 1.0.0"
相关推荐
SelectDB43 分钟前
易车 × Apache Doris:构建湖仓一体新架构,加速 AI 业务融合实践
大数据·agent·mcp
雮尘4 小时前
让 AI Agent 高效并行开发的命令-git worktree
人工智能·git·agent
武子康8 小时前
大数据-241 离线数仓 - 实战:电商核心交易数据模型与 MySQL 源表设计(订单/商品/品类/店铺/支付)
大数据·后端·mysql
IvanCodes8 小时前
一、消息队列理论基础与Kafka架构价值解析
大数据·后端·kafka
南果梨1 天前
OpenClaw 完整教程!从安装到使用(官方脚本版)
前端·git·开源
武子康1 天前
大数据-240 离线数仓 - 广告业务 Hive ADS 实战:DataX 将 HDFS 分区表导出到 MySQL
大数据·后端·apache hive
洛森唛2 天前
ElasticSearch查询语句Query String详解:从入门到精通
后端·elasticsearch
Selicens2 天前
git批量删除本地多余分支
前端·git·后端
字节跳动数据平台2 天前
5000 字技术向拆解 | 火山引擎多模态数据湖如何释放模思智能的算法生产力
大数据
武子康2 天前
大数据-239 离线数仓 - 广告业务实战:Flume 导入日志到 HDFS,并完成 Hive ODS/DWD 分层加载
大数据·后端·apache hive