Git使用点滴记录

问题及解决方案list:

  • your configuration specifies to merge with the ref ‘master’ from the remote, but no such ref was fetched.

    出现在,没有push而进行pull操作的时候

  • No refs in common and none specified; doing nothing.
    Perhaps you should specify a branch such as ‘master’.

    出现在clone后首次push,这是因为Git找不到要提交的版本。
    解决方法

     git push origin master
  • 将某个目录或者文件移除出版本控制
    git rm 命令参数

    -n --dry -run 
    Don’t actually remove any file(s). Instead, just show if they exist in the index and would otherwise be removed by the command.
     -r 
    Allow recursive removal when a leading directory name is given. 
     --cached 
    Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone. 

    解决方法

    git rm -r -n --cached "bin/" //-n:加上这个参数,执行命令时,是不会删除任何文件,而是展示此命令要删除的文件列表预览。
    git rm -r --cached  "bin/"      //最终执行命令. 
    git commit -m" remove bin folder all file out of control"    //提交
    git push origin master   //提交到远程服务器
  • git 错误 fatal: This operation must be run in a work tree
    由于创建一个裸仓库,在该仓库无法进行任何git操作,所以抛出错误.
    解决方法
    在该仓库目录下,新建文件夹,进入该文件夹,执行如下命令:

    1. touch Readme
    2. git init
    3. git add Readme
    4. git commit -m 'initial commit' Readme
  • you are on a branch yet to be born
    在运行 git checkout -f时出现。因为当前主分支下还是空的。

    git checkout -b master
    git update-ref HEAD master
    git push --set-upstream origin master
  • 无法定位程序输入点 libiconv 于动态链接库 libiconv-2.dll 上
    解决方法
    手动将“C:\ProgramFiles(x86)\Git\bin\”目录中的文件“libiconv-2.dll”复制到”C:\ProgramFiles(x86)\Git\libexec\git-core”目录下。

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值