Git操作

一、GIT下载代码

bash 复制代码
git clone xxx.git

二、Git上传代码

  1. 修改代码后,查看所有的修改项目。
bash 复制代码
git status
  1. 将所有修改的项目添加到本地
bash 复制代码
git add .
  1. 添加代码提交备注信息
bash 复制代码
git commnit -m "xxxxxxxx"
  1. 提交代码到远程服务器
c 复制代码
git push -u origin master

三、打TAG

Git打标签(tag)是为了标记特定的开发点,比如版本发布。以下是如何使用git命令打标签的步骤:

  1. 创建轻量级标签:
bash 复制代码
git tag <tagname>
  1. 创建带有注释的标签:
bash 复制代码
git tag -a <tagname> -m "<message>"
  1. 列出所有标签:
bash 复制代码
git tag
  1. 推送特定标签到远程仓库:
bash 复制代码
git push origin <tagname>
  1. 推送所有本地标签到远程仓库:
bash 复制代码
git push --tags
  1. 删除本地标签:
bash 复制代码
git tag -d <tagname>
  1. 删除远程标签:

首先删除本地标签,然后:

bash 复制代码
git push --delete origin <tagname>

检出标签:

bash 复制代码
git checkout <tagname>

例如,创建一个带注释的v1.0.0标签:

bash 复制代码
git tag -a v1.0.0 -m "Release version 1.0.0"

然后将其推送到远程仓库:

bash 复制代码
git push origin v1.0.0
相关推荐
REDcker1 小时前
Git分支可视化管理面板设计与选型
git
Chan162 小时前
MCP 开发实战:Git 信息查询 MCP 服务开发
java·开发语言·spring boot·git·spring·java-ee·intellij-idea
yanlaifan2 小时前
恢复git硬删除的commit
git
学渣y5 小时前
git分布式版本控制系统
分布式·git·elasticsearch
时空无限6 小时前
git 文件冲突之后如何操作
git
Jul1en_7 小时前
【Git】利用 LFS 突破 GitHub 大文件上传限制
git·github
云巅的cat8 小时前
Git 使用指南
git·github
yeziyfx18 小时前
vs code 使用Git拉取/克隆(clone)仓库项目
git·vscode
smachao1 天前
Redis Desktop Manager(Redis可视化工具)安装及使用详细教程
redis·git·bootstrap
szcsun51 天前
git的常用命令
git