CentOS下Git升级
1. 环境描述 2. 升级安装流程 2.1. 第一步卸载原有的git 2.2. 安装相关依赖 2.3. 安装git 3. 编译中问题解决 1. 环境描述 centos7系统默认的git安装版本是1.8,但是在项目构建中发现git版本过低,于是用源码编译的方式进行升级.同时该文章也适用于安装新的git,相信… 阅读更多 »CentOS下Git升级
1. 环境描述 2. 升级安装流程 2.1. 第一步卸载原有的git 2.2. 安装相关依赖 2.3. 安装git 3. 编译中问题解决 1. 环境描述 centos7系统默认的git安装版本是1.8,但是在项目构建中发现git版本过低,于是用源码编译的方式进行升级.同时该文章也适用于安装新的git,相信… 阅读更多 »CentOS下Git升级
1. Git submodule 1.1. submodule常用命令 在项目中的.gitmodules文件中查看当前submodule设置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
git clone <repository> --recursive #递归的方式克隆整个项目 git submodule add <repository> <path> #添加子模块 #示例:git submodule add https://github.com/c-ares/c-ares.git third_party/cares/cares -b cares-1_12_0 git submodule init #初始化子模块 git submodule update --init --recursive #初始化并更新子模块 git submodule foreach git pull #拉取所有子模块 git pull --recurse-submodules #拉取所有子模块中的依赖项 git submodule sync #将新的URL同步更新,该步骤适用于git submodule add或修改.gitmodules文件之后 git submodule status third_party/ModuleA #查看子模块状态,即该子模块切入的提交节点位置,即某HASH值 #删除子模块,然后删除对应资源库所有文件 git rm --cached ModuleA rm -rf moduleA git submodule set-url third_party/ModuleA https://XXX.git #,更新子模块URL,该功能在1.8.3.1以上版本 git submodule set-branch --branch dev third_party/ModuleA #设置子模块项目采用的分支,该功能在1.8.3.1以上版本 |
若希望每次clone拉取新的submodule到指定分支指定节点,需要在提交时将子模块checkout到指定指针位置,然后… 阅读更多 »Git submodule子模块的使用
Git中文开发手册:https://www.php.cn/manual/view/34943.html 这个是git的中文使用参考手册,描述git的中高级使用命令及参数。 Git中文教程(菜鸟教程):https://www.runoob.com/git/git-tutorial.html 这个是入门级别git使用教学,简述基础功… 阅读更多 »GIT参考手册
1.CRLF、LF、CR三种方式含义
1 2 3 4 5 6 7 |
CRLF->Windows style LF->Unix Style CR->Mac Style CRLF表示句尾使用回车换行两个字符(即我们常在Windows编程时使用"\r\n"换行) LF表示表示句尾,只使用换行. CR表示只使用回车. |
2.通过Git的全局配置进行修改
1 2 3 4 5 6 7 8 |
# 表示自动更换crlf,windows下如果checkout是\n,则自动换为\r\n,在提交时在自动换回\n git config --global core.autocrlf true #自动把\r\n换为\n git config --global core.autocrlf input #提交检出均不转换不作处理 git config --global core.autocrlf false |
core.autocrlf是git中负责处理line endings的变量,可以设置三个值–true… 阅读更多 »git提交不同平台文件的换行格式处理(转载)
Git tag打标签以及推送到远程仓库详解。 git tag用作上线发布的时候打tag处理。 git tag -a -m “added release notes” 处理命令为:
1 2 3 4 5 6 7 8 |
git tag -a v1.0-beta -m "v1.0 beta版本发布上线" git tag # 查看tag列表 git tag --list # 查看tag列表 git tag -l # 同理查看tag列表 # 此处对历史提交做tag处理 git log --pretty=oneline --abbrev-commit git tag -a v0.9 -m "v0.9版本发布上线" <commit-id> # 对历史提交做tag处理 |
– 推送本地标签到远程仓库 [crayon-603a880521c41986989… 阅读更多 »git tag标签命令详解
github下载慢或报错“The-remote-end-hung-up-unexpectedly”解决办法:该问题往往因为内部网络限制等因素导致。 因细节更新,欢迎访问本文源站链接:https://turbock79.cn/?p=173。 1.方法一 解决gitbub下载慢问题,可… 阅读更多 »github下载慢或报错“The-remote-end-hung-up-unexpectedly”解决办法
1.git clone 把远程库克隆到本地文件夹
1 2 3 4 5 6 7 8 9 10 11 12 |
git clone -b dev https://gitee.com/XXX/EmpManage //直接克隆远程dev分支到本地dev分支 //相当于如下操作 git clone https://gitee.com/XXX/XXXManage //克隆远程仓库主分支 cd XXXManage git status //查看当前状态 git branch -a //查看所有分支 //git branch -d dev //删除分区命令 git checkout -b dev //当前PC本地仓库创建一个新分区 git pull origin dev //拉取远程origin/dev分支到当前路径(git branch dev remotes/origin/dev) git checkout dev //切换到dev分支 |
2.编辑本地仓库文件并提交到本地信息库(git add ./git commit)
1 2 3 4 |
nano README.md //读取README.md文件中内容 ... git add . //git add --all //git add AAA.hpp bbb.cpp git commit -m “x修改信息” //提交当前状态到本地分支并附上修改信息 |
3.将本地库提交到远程Git服务器 [crayon-603a88… 阅读更多 »git提交合并分支及回退