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

相关推荐
fpcc8 小时前
工具使用—git add命令分析说明
git·工具
独隅12 小时前
VS Code Git 工作树多分支并行开发实战指南
大数据·git·elasticsearch
丑过三八线19 小时前
Git 合并未合并分支完整教程
git
qq_349447951 天前
Linux系统,安装git,从使用git下载仓库(GitHub, Gitee, GitLab 等),并且使用ssh密钥,可以直接执行git pull
linux·git·ssh
凯尔萨厮2 天前
Git(学习笔记)
笔记·git·学习
一技安身2 天前
【Git】零基础入门实战教程(Windows 完整版,适配竞赛仓库)
windows·git
LXY_BUAA2 天前
Git_在飞牛中部署 GitLab_20260817
git·gitlab
阳墨余2 天前
Git 同时管理 Gitee 和 GitHub 的 SSH 配置实战
git·gitee·github
fengyehongWorld2 天前
Git 认证凭据管理
git
暮云星影3 天前
git版本发布
git·gitee·github·gitea