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
相关推荐
大筒木老辈子1 天前
Git笔记---其他常用操作
笔记·git
小二·1 天前
Git 高频操作命令大全(分类整理 + 修正说明)
大数据·git·elasticsearch
目南殇1 天前
Git 命令基础使用指南:从初始化到提交的完整流程
git
crossoverJie1 天前
Git cherry-pick 使用小技巧
git·github
、shadow1 天前
切换GIT账号
git
因为奋斗超太帅啦1 天前
Git分布式版本控制工具学习笔记(一)——git本地仓库的基本使用
笔记·git·学习
BestOrNothing_20152 天前
Git 中新建学习分支 + 暂存修改 + VSCode 可视化查看改动(超详细教程)
git·vscode·版本控制·开发技巧
正经教主2 天前
【Git】Git03:Git版本回退、文件修改与撤销
git
QX_hao2 天前
【git】--远程Git仓库的名称发生更改
git
正经教主2 天前
【Git】Git04:分支管理
git