-
git删除分支
git branch -d tinatan
-
git提交远程仓库
git push origin tcp:tcp
-
git删除远程分支
git push origin --delete PDA
-
git提交的时候忽略掉某个文件
-
git拉取远程分支并创建本地分支
git checkout -b PDA origin/PDA
-
git创建本地分支
git checkout -b PDA tiantan
-
git变基
git pull --rebase origin tiantan
-
git变基后强制提交
git push origin HEAD:wei -f
-
git不提交某个文件
git update-index --assume-unchanged 要忽略的文件夹/文件夹下文件名
-
git恢复不提交某个文件
git update-index --no--assume-unchanged 要忽略的文件夹/文件夹下文件名
-
git本地版本回退
git reset --soft <commit-id> //修改内容还在暂存区
git reset --hard <commit-id> //所有修改内容被清除
-
git客户端解决中文乱码
git config --global core.quotepath false
-
设置git编码utf-8
set LESSCHARSET=utf-8
-
使用utf-8编码集提交
git config --global i18n.commitencoding utf-8
-
日志输出时使用utf-8编码集显示
git config --global i18n.logoutputencoding utf-8
git操作规范
git操作规范:
比如:设备module开发
1、基于develop分支创建 : git checkout -b feature/device
2、基于feature/device开发,完成后commit
3、切换到develop分支,git fetch -p 检查下是否有更新;有更新则git pull,然后切换到feature/device进行rebase,最后回到develop分支git merge feature/device --no-ff;若无更新,则直接git merge feature/device --no-ff
4、git push