使用命令行管理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"
相关推荐
LplLpl112 小时前
AI 算法竞赛通关指南:基于深度学习的图像分类模型优化实战
大数据·人工智能·机器学习
小生不才yz2 小时前
(二)日常工作流 - git mv 命令的使用
git
一点事3 小时前
git:推送本地项目到远程仓库进行管理(完整流程)
git
庄小焱3 小时前
大数据治理域——数据资产管理示例
大数据·数据治理·大数据治理·数据治理实践
WordPress学习笔记5 小时前
专业建外贸网站公司推荐
大数据·前端·人工智能
Julian.zhou6 小时前
Anthropic破解长程任务难题:长期运行智能体的高效控制机制
大数据·人工智能
小镇学者6 小时前
【PHP】macos 系统 git pull 时 报错File name too long问题
git·macos·php
艾莉丝努力练剑7 小时前
【Git:企业级开发模型】Git企业级Git工作流实战:基于Git Flow的分支模型与开发流程
服务器·git·ubuntu·gitee·centos·powershell·企业级开发模型
%KT%7 小时前
Git版本管理
git
白日做梦Q8 小时前
Navicat for MySQL 详细使用指南:命令行操作与界面操作双视角全解析
大数据·mysql·adb·数据库开发