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 小时前
git add . 是否会包含.o、.so、.ko文件?深度解析与避坑指南
git
牟同學2 小时前
Git 实战场景操作大全(可直接落地)
git
不做无法实现的梦~3 小时前
使用ros2跑mid360的fastlio2建图
git·单片机·嵌入式硬件·gitcode
长沙红胖子Qt5 小时前
SVN培训笔记(二):使用sourceTree通过git桥接管理svn项目
git·svn·sourcetree·sourcetree管理svn
半夏微凉半夏殇6 小时前
从多仓库到单仓库:如何高效迁移并统一管理多个Git项目
git
__万波__7 小时前
解决警告“..LF will be replaced by CRLF the next time Git touches it“
git
Software攻城狮7 小时前
git报错处理
git
明洞日记8 小时前
【软考每日一练015】计算机网络:DNS 递归查询与迭代查询解析
git·计算机网络·github
安河桥畔8 小时前
Git使用
大数据·git·elasticsearch
会跑步的蜗牛8 小时前
git相关问题(个人记录)
git