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

相关推荐
星晨雪海2 小时前
Idea中使用Git详细教程
git
丶党玲儿3 小时前
AI-agent工程化(开源git分享)
人工智能·git·开源
笑虾3 小时前
Git 学习笔记 - 合并
git
明月夜&4 小时前
Ubuntu 20.04 Docker 部署 Ollama + DeepSeek-Coder:本地 AI 编程助手实战
git·vscode·ubuntu·docker·大语言模型·智能体
如此热烈走向夏天4 小时前
科研中常用的GIT常用指令
git
辞旧 lekkk5 小时前
【Git】远程操作与标签管理
linux·git·学习·萌新
重生的黑客5 小时前
Linux 开发工具:Git 版本控制与 GDB 调试入门
linux·运维·git
某人辛木5 小时前
Git推送到GitHub仓库遇到的问题
git·github
Robot_Nav1 天前
Git 项目维护命令指南相关讲解
git·机器人·github
i建模1 天前
强制同步远程git仓库
git