随笔分类 -  Git

摘要:git status中文显示乱码解决: git config --global core.quotepath false git log中文乱码解决: git config --global gui.encoding utf-8 git config --global i18n.commitenco 阅读全文
posted @ 2021-05-31 18:07 船长博客 阅读(478) 评论(0) 推荐(0) 编辑
摘要:git log #查看commit id git reset --hard 74b6210ec0b #这里是commit id git push -f # 强制推上去 阅读全文
posted @ 2021-04-06 18:29 船长博客 阅读(595) 评论(0) 推荐(0) 编辑
摘要:问题原因:使用存储的旧账户访问新的git仓库 1. Linux 检查~/.git-credentials 修改或删除其中的旧的账户密码,新打开命令行窗口重新push 2. MAC 是cmd + space 搜索钥匙串访问,找到github能看到保存的账户和密码 3. WINDOWS 控制面板->所有 阅读全文
posted @ 2021-04-06 18:26 船长博客 阅读(469) 评论(0) 推荐(0) 编辑
摘要:有时候确实是密码输入错误,登陆gitlab重置下密码。 gitlab的https用户定义密码认证方式被关闭了,那就改成ssh方式在项目根目录: git remote set-url origin git@git.example.com:test.git 将项目从https源换成ssh 本机生成SSH 阅读全文
posted @ 2020-07-10 20:17 船长博客 阅读(9223) 评论(0) 推荐(2) 编辑
摘要:进入settings=>repository=>protected branches里,修改Allowed to push为Developers + Maintainers 或者直接点击Unprotect. developer权限也可提交代码 master分支下修改了文件,计划push,发现没有权限 阅读全文
posted @ 2020-04-14 16:33 船长博客 阅读(3459) 评论(0) 推荐(2) 编辑
摘要:git branch日期排序 vi ~/.gitconfig [alias]lb = !"for k in `git branch -a|perl -pe s/^..//`;do echo `git show --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset 阅读全文
posted @ 2018-08-06 10:29 船长博客 阅读(2873) 评论(0) 推荐(0) 编辑
摘要:背景:同一台电脑的public key同时添加到了github的两个账户,导致user1的仓库没法正常提交。 解决办法:为两个账户分别配置ssh key,配置~/.ssh/config文件(windows下也是这个路径,在git bash中可以识别~) 错误: $ git push remote: 阅读全文
posted @ 2017-03-20 18:46 船长博客 阅读(3005) 评论(0) 推荐(0) 编辑
摘要:1、项目根目录下创建.gitignore vi .gitignore #输入需要忽略的文件,支持正则表达式, *.o *.exe*.pyc 可以用git status来检查是否生效 未添加文件前: MacPro:python apple$ git status Untracked files: (u 阅读全文
posted @ 2017-02-02 12:26 船长博客 阅读(831) 评论(0) 推荐(0) 编辑

永远相信美好的事情即将发生!
点击右上角即可分享
微信分享提示