随笔分类 - Git
摘要:运行 git checkout -b dev origin/dev 报错 "Cannot update paths and switch to branch at the same time" 处理步骤: 1、首先确定远程仓库是否有dev这个分支 2、git remote -v 看看你是否有fetc
阅读全文
摘要:本地创建带附注标签 $ git tag -a <版本号> -m "<备注信息>" 本地创建轻量级标签 $ git tag <版本号>-light 本地对指定commit创建标签 $ git tag -a <版本号> <SHA值> -m "<备注信息>" 本地删除标签 $ git tag -d <版本
阅读全文
摘要:ps:这个命名规范是自己总结的习惯使用的命名规范,不是最佳实践。依据Git Flow 主分支:master 开发分支:develop hotfix分支:线上bug修复,从master拉取hotfix分支。 命名为:hotfix/姓名简写/日期/[修复描述],例如:hotfix/lyj/2019122
阅读全文
摘要:查看自己用户名和邮箱地址: $ git config user.name $ git config user.email 修改自己用户名和邮箱地址: git config --global user.name xxx git config --global user.email xxxx@163.c
阅读全文
摘要:¤ 查看本地分支: git branch ¤ 修改分支名称:git branch -m 原名 新名 ¤ 查看所有远程分支和本地分之: git branch -a 用git remote prune origin 清除branch -a的无用分支 ¤ 创建分支: git branch test 或者
阅读全文
摘要:场景一: 已经用git add 命令把文件加入到暂存区了,这个时候想退回怎么办? 添加文件到暂存区 :git add . 将单个文件撤回到工作区:git rm --cached [文件路径] 将目录撤回到工作区:git rm -r --cached [文件目录] 或者使用 git reset HEA
阅读全文
摘要:Git修改远程仓库地址 1.修改命令 git remote set-url origin [url] 例如:$ git remote set-url origin gitlab@gitlab.chumob.com:php/hasoffer.git 2.先删后加 git remote rm origi
阅读全文