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
相关推荐
随便取个六字3 小时前
GIT操作 学习
git·学习
星源~13 小时前
tree 命令集成到 Git Bash:可视化目录结构的指南
git·单片机·物联网·嵌入式·项目开发
zhaqonianzhu14 小时前
git gerrit安装钩子
git·gerrit
这是个栗子14 小时前
【问题解决】VSCode终端中看不到Git-Bash
ide·git·vscode
悲伤小伞14 小时前
linux_git的使用
linux·c语言·c++·git
天机️灵韵15 小时前
云效DevOps vs Gitee vs 自建GitLab的技术选型
git·开源项目
荔枝吻21 小时前
【AI总结】Git vs GitHub vs GitLab:深度解析三者联系与核心区别
人工智能·git·github
mrbone111 天前
Git-git worktree的使用
开发语言·c++·git·cmake·worktree·gitab
小哈龙1 天前
裸仓库 + Git Bash 搭建 本地 Git 服务端与客户端
开发语言·git·bash
GISer_Jing1 天前
Git协作开发:feature分支、拉取最新并合并
大数据·git·elasticsearch