Git开发常用命令总结

Git开发常用命令总结

克隆仓库

复制代码
git clone --depth 3 -b 17.0 --single-branch https://github.com/odoo/odoo.git odoo17

参数说明:

  • --depth 3 : 只克隆最近提交的3条记录到本地。
  • -b 17.0 --single-branch : 只拉取分支 17.0

拉取仓库

git pull <远程主机名> <远程分支名>:<本地分支名>

复制代码
git pull origin master:master

新建和切换分支

git switch和git checkout

远程库增删改查

复制代码
git remote add <远程库名> <远程库地址>
git remote remove <远程库名>
git remote rename <原远程库名> <新远程库名>
git remote set-url <远程库名> <远程库地址>

# 查看所有远程库信息
git remote -v

git 创建空分支 https://blog.csdn.net/linyichao1314/article/details/136956650

Git 实用技巧2------新建空白分支 | 重命名分支 | 回退到历史 commit https://blog.csdn.net/m0_49270962/article/details/137759940

相关推荐
程序员鱼皮4 小时前
Git WorkTree 是什么?凭什么能让 AI 编程效率翻倍?
git·ai·程序员·编程·ai编程
懵逼的小黑子7 小时前
git与远程仓库创建连接
git
前端若水7 小时前
Git 撤销与恢复完全指南(超级详细版)
大数据·git·elasticsearch
golang学习记7 小时前
Git 2.54 来了,这个新命令让我终于敢重写历史了
git·后端
其实防守也摸鱼7 小时前
AWVS下载和安装保姆级教程
linux·服务器·git
前端若水7 小时前
Git 可以做的所有操作(完整分类)
大数据·git·elasticsearch
叹一曲当时只道是寻常8 小时前
Reference 工具安装与使用教程:一条命令管理 Git 仓库引用与知识沉淀
人工智能·git·ai·开源·github
前端若水8 小时前
Git 仓库管理命令完全指南(超级详细版)
大数据·git·elasticsearch
小MarkK9 小时前
[Doc]git的使用之不上传服务器,只在本地管理
git
YoseZang20 小时前
【手工】git的使用 – 使用git进行项目协作
git