查看“Git”的源代码
←
Git
跳转至:
导航
,
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
== SSH key生成 == === windows === <source lang="shell"> #生成ssh key的命令 qingwyan@QINGWYAN-FTCEW MINGW64 ~/Desktop/git $ ssh-keygen -t rsa -C "qingwyan@cisco.com" # 进入到生成的ssh key目录 qingwyan@QINGWYAN-FTCEW MINGW64 ~/Desktop/git $ cd /c/Users/qingwyan/.ssh # copy到剪切板 qingwyan@QINGWYAN-FTCEW MINGW64 ~/.ssh $ clip < id_rsa.pub </source> == 常见错误 == === git pull/fetch: unable to update local ref === * 现象 <source lang="shell"> [qingwyan@crdc-sdn-ucs2 rpd-service-manager]$ git fetch error: there are still refs under 'refs/remotes/origin/bugfix/haofan' From ssh://bitbucket-eng-sjc1.cisco.com:7999/cmtsorch/rpd-service-manager ! [new branch] bugfix/haofan -> origin/bugfix/haofan (unable to update local ref) </source> * 解决方案:删除文件 <source lang="shell"> rm -rf .git/refs/remotes/origin/bugfix/haofan </source> * 新的问题 <source lang="shell"> [qingwyan@crdc-sdn-ucs2 rpd-service-manager]$ git fetch error: 'refs/remotes/origin/bugfix/haofan/device-key' exists; cannot create 'refs/remotes/origin/bugfix/haofan' From ssh://bitbucket-eng-sjc1.cisco.com:7999/cmtsorch/rpd-service-manager ! [new branch] bugfix/haofan -> origin/bugfix/haofan (unable to update local ref) error: some local refs could not be updated; try running 'git remote prune origin' to remove any old, conflicting branches </source> * 按提示删除 <source lang="shell"> git remote prune origin </source> == 常用命令 == === 当前分支commit数量 === <source lang="shell"> # 获取当前分支的 commit 数量 git rev-list HEAD --count # 比上面的少点 ---上面的会有重复的,少了些重复的, >< 我也不知道。。。 git rev-list HEAD --count --first-parent </source> === 回滚到上一个commit === <source lang="shell"> git reset --hard <commit_id> git push origin HEAD --force </source> === git diff忽略^M === <source lang="shell"> git config --global core.whitespace cr-at-eol </source>
返回至
Git
。
导航菜单
个人工具
创建账户
登录
命名空间
页面
讨论
不转换
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
台灣正體
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息