Skip to main content

git新命令及别名

git命令简写(ohmyzsh中)#

原始命令简写命令备注
git statusgst查看
变化状态
git diffgd查看
代码改动
git addga
git pullgl拉取代码
git pushgp推送
git push --set-upstream origingpsup $()推送本地分支到远程
git branchgb查看分支
git checkoutgco切换分支
git checkout -bgcb新建分支
git branch -Dgbd删除分支
git log --statglg查看提交

官方手册

git 两个新命令来拆分git checkout(version: 2.23.0)#

git swtich

git switch -c t1
git switch main
// 等同于
git checkout -b t1
git checkout main
git switch -d cac2fbac22b0ec6a168984351327ec37b14349aa
HEAD is now at cac2fbac chore(lcof2): change images path
git:(cac2fbac)
git reset --hard c2db695e1c40b43b71e9e44497724b0b76179639
HEAD is now at c2db695e feat: add solutions to lc problem: No.0493.Reverse Pairs

git restore 表示将在工作空间但是不在暂存区的文件撤销更改


slug: 2021DDay title: 253 author: Zhao chen author_url: https://github.com/zhaocchen tags: [周记] draft: false

description:#

  • 前端技术沙龙
  • 像素、像素密度、DPI、PPI、DPR
  • iphoneX系列适配问题

https://www.ui.cn/detail/416445.html https://segmentfault.com/a/1190000016534976

机型判断

/**
* 判断设备是否是iPhoneX
*/
export const isIphoneX = function isIphoneX() {
const iPhone = /iphone/gi.test(window.navigator.userAgent);
if (
iPhone &&
window.devicePixelRatio &&
window.devicePixelRatio === 3 &&
window.screen.width === 375 &&
window.screen.height === 812
) {
// iPhone X、iPhone XS
return true;
}
if (
iPhone &&
window.devicePixelRatio &&
window.devicePixelRatio === 3 &&
window.screen.width === 414 &&
window.screen.height === 896
) {
// iPhone XS Max
return true;
}
if (
iPhone &&
window.devicePixelRatio &&
window.devicePixelRatio === 2 &&
window.screen.width === 414 &&
window.screen.height === 896
) {
// iPhone XR
return true;
}
if (iPhone && window.screen.width === 390 && window.screen.height === 844) {
// iPhone 12/ iPhone 12 Pro
return true;
}
if (iPhone && window.screen.width === 428 && window.screen.height === 926) {
// iPhone 12 Pro Max
return true;
}
return false;
};
  • safari technology preview 调试
  • _.pick 过滤key
  • 时间函数: dayjs
  • git可视工具, soucetree
  • h5键盘兼容性

https://juejin.cn/post/6844903780731846663

  • babel1